Skip to content

fix: clean up env directory after failure#61

Merged
richardlau merged 1 commit intonodeshift:mainfrom
richardlau:cleanup
Aug 20, 2021
Merged

fix: clean up env directory after failure#61
richardlau merged 1 commit intonodeshift:mainfrom
richardlau:cleanup

Conversation

@richardlau
Copy link
Copy Markdown
Member

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

@richardlau
Copy link
Copy Markdown
Member 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.

Comment thread src/cli.js Outdated
If a module fails to install, clean up the env directory before
attempting the next module.
@helio-frota
Copy link
Copy Markdown
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