Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clean up env directory after failure #61

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

richardlau
Copy link
Contributor

If a module fails to install, clean up the env directory before
attempting the next module.

@richardlau
Copy link
Contributor Author

richardlau commented Aug 20, 2021

I've pushed this up as-is as it is the end of my working day. I'd like to add a test for this somehow.

src/cli.js Outdated Show resolved Hide resolved
If a module fails to install, clean up the env directory before
attempting the next module.
@helio-frota
Copy link
Member

I think for this specific case that is enough since the cleanEnvDirectory is already covered by tests
it('should clean the npcheck-env directory', () => {...

Also npcheck has no cli.js test yet, and creating a test for this also means checking the error messages and etc.
For example to validate error messages like this:

`Module "${pkgInfo.name}" couldn't be installed. Check ${logs} for more information.`

ofc is doable but I don't think that should be done now to cover that change on cli.js 👍

@helio-frota helio-frota self-requested a review August 20, 2021 18:02
@richardlau richardlau merged commit 611aeb0 into nodeshift:main Aug 20, 2021
@richardlau richardlau deleted the cleanup branch August 20, 2021 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants