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

Do not clobber process properties with test mocks #783

Merged
merged 1 commit into from
Jul 17, 2019

Conversation

raphinesse
Copy link
Contributor

According to the last section Dot notation in the rewire docs, the code from #774 permanently clobbers various properties on the process global. This PR fixes #768 without permanently altering process.

CC @breautek

Copy link
Contributor

@brodycj brodycj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a suggestion as I didn’t quite get it at first that spyOn would stop the actual function from being executed by default (unless .and.callThrough() is chained on). I think it would be nice to add a comment to make this clear for the sake of others. Otherwise, the change looks perfect to me.

@raphinesse please feel free to edit or delete my suggested comment when merging.

spec/unit/run.spec.js Show resolved Hide resolved
@brodycj brodycj mentioned this pull request Jul 16, 2019
5 tasks
@raphinesse raphinesse changed the title Do not clobber globals with test mocks Do not clobber process properties with test mocks Jul 16, 2019
@raphinesse raphinesse merged commit 997943a into apache:master Jul 17, 2019
@raphinesse raphinesse deleted the no-clobber-globals branch July 17, 2019 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jasmine doesn't print all of its test output on Node 12
2 participants