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

test infra: mocks and skipOnWin conflict #862

Closed
nfischer opened this issue Jun 25, 2018 · 0 comments · Fixed by #863
Closed

test infra: mocks and skipOnWin conflict #862

nfischer opened this issue Jun 25, 2018 · 0 comments · Fixed by #863
Assignees
Labels

Comments

@nfischer
Copy link
Member

I observed this while reviewing PR #861. If a test suite uses mocks.init() and also uses skipOnWin, skipOnWin should output stderr indicating the test is skipped, but the message is actually suppressed by mocks.

We can fix this by capturing process.stderr.write on startup, within utils.js, instead of using console.warn() directly.

@nfischer nfischer added the test label Jun 25, 2018
@nfischer nfischer self-assigned this Jun 25, 2018
nfischer added a commit that referenced this issue Jun 25, 2018
This fixes a conflict between mocks.init() and
utils.skipOnWin/skipOnUnix. mocks.init() mocks out process.stderr.write,
which utils.js implicitly depends on.

Instead, preserve stderr.write in a local variable to avoid polluting
mocked stdio and to correctly output warning messages.

Fixes #862
Test: locally apply mocks.init() inside test/which.js
nfischer added a commit that referenced this issue Jun 28, 2018
This fixes a conflict between mocks.init() and
utils.skipOnWin/skipOnUnix. mocks.init() mocks out process.stderr.write,
which utils.js implicitly depends on.

Instead, preserve stderr.write in a local variable to avoid polluting
mocked stdio and to correctly output warning messages.

Fixes #862
Test: locally apply mocks.init() inside test/which.js
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 a pull request may close this issue.

1 participant