You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend that you not install Mocha globally.
Description
Watch mode with async global teardown hooks doesn't work properly when run via yarn. It could very well be yarn's fault, but I haven't seen weird behavior like this with any other scripts that do tricky child process spawning...
I would expect at least a 1 second pause before exit with yarn as well, but for some reason it doesn't.
Actual behavior: [What actually happens]
When I run yarn test:watch, it exits almost immediately after I Ctrl-C, sometimes even printing ⚠ [mocha] cleaning up, please wait... after the next command prompt.
Additionally, if I press the up key after I Ctrl-C:
If less than one second has elapsed, I get this strange error:
node_modules/mocha/lib/runner.js:962
throw err;
^
Error: read EIO
at TTY.onStreamRead (internal/stream_base_commons.js:205:27)
Emitted 'error' event on ReadStream instance at:
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'EIO',
code: 'EIO',
syscall: 'read'
}
If more than one second has elapsed, it prints ^[[A instead of the previous command (even though pressing enter will still run the previous command)
Reproduces how often: [What percentage of the time does it reproduce?]
Consistently
Versions
The output of mocha --version and node node_modules/.bin/mocha --version: 8.3.0
The output of node --version: 14.11.0, doesn't seem to matter
Your operating system
name and version: macOS 11.2.1
architecture (32 or 64-bit): 64-bit
Your shell (e.g., bash, zsh, PowerShell, cmd): bash
The text was updated successfully, but these errors were encountered:
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
Watch mode with async global teardown hooks doesn't work properly when run via yarn. It could very well be yarn's fault, but I haven't seen weird behavior like this with any other scripts that do tricky child process spawning...
Steps to Reproduce
Repo: https://github.com/jedwards1211/yarn-mocha-watch
package.json
teardown.js
test.js
Expected behavior: [What you expect to happen]
When I run
npm run test:watch
, and then Ctrl-C, I see the following:I would expect at least a 1 second pause before exit with yarn as well, but for some reason it doesn't.
Actual behavior: [What actually happens]
When I run
yarn test:watch
, it exits almost immediately after I Ctrl-C, sometimes even printing⚠ [mocha] cleaning up, please wait...
after the next command prompt.Additionally, if I press the up key after I Ctrl-C:
^[[A
instead of the previous command (even though pressing enter will still run the previous command)Reproduces how often: [What percentage of the time does it reproduce?]
Consistently
Versions
mocha --version
andnode node_modules/.bin/mocha --version
: 8.3.0node --version
: 14.11.0, doesn't seem to matterThe text was updated successfully, but these errors were encountered: