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

tests(config-helpers): restore process.cwd after mocking #14036

Merged
merged 2 commits into from
May 24, 2022

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