Skip to content

Conversation

@connorjclark
Copy link
Collaborator

The test overwrites process.cwd but never restores it.

Also, the process global is special, being injected into the scope of every module and not necessarily going through the require/import process (so can't be mocked with jest.mock that way unless the module under test explicitly imports it, which we don't). So I removed the usage of jest.mock.

@connorjclark connorjclark requested a review from a team as a code owner May 21, 2022 01:09
@connorjclark connorjclark requested review from brendankenny and removed request for a team May 21, 2022 01:09
@connorjclark connorjclark changed the title tests(config-helpers): restore process.cwd properly after mocking tests(config-helpers): restore process.cwd after mocking May 24, 2022
@connorjclark connorjclark merged commit 48d069d into master May 24, 2022
@connorjclark connorjclark deleted the conf-help-test-mock branch May 24, 2022 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants