28.1.3
Steps to reproduceyarn install
onRunComplete
and onRunStart
methods if you are not using vscode-jest
extension in vscode
vscode-jest
extension:yarn test --watchAll --no-coverage --reporters default --reporters "/your-vscode-extension-path/vscode-jest/out/reporter.js"
you should see something like this:
● Test suite failed to run
Cannot find module 'vue-template-compiler'
Require stack:
- /jest-async-fail-main/node_modules/@vue/vue2-jest/lib/process.js
- /jest-async-fail-main/node_modules/@vue/vue2-jest/lib/index.js
- /jest-async-fail-main/node_modules/jest-util/build/requireOrImportModule.js
- /jest-async-fail-main/node_modules/jest-util/build/index.js
- /jest-async-fail-main/node_modules/jest-config/build/getCacheDirectory.js
- /jest-async-fail-main/node_modules/jest-config/build/Defaults.js
- /jest-async-fail-main/node_modules/jest-config/build/normalize.js
- /jest-async-fail-main/node_modules/jest-config/build/index.js
- /jest-async-fail-main/node_modules/jest-cli/build/init/index.js
- /jest-async-fail-main/node_modules/jest-cli/build/cli/index.js
- /jest-async-fail-main/node_modules/jest-cli/build/index.js
- /jest-async-fail-main/node_modules/jest-cli/bin/jest.js
- /jest-async-fail-main/node_modules/jest/bin/jest.js
at Object.<anonymous> (node_modules/@vue/vue2-jest/lib/process.js:1:29)
onRunStart
Test Suites: 0 of 2 total
Tests: 0 total
Snapshots: 0 total
The onRunComplete
, which should output "onRunComplete", is never invoked.
the reporter should receive onRunComplete
callback with at least testResult.testExecError populated.
reporter onRunComplete
was never called.
We discovered this issue during the investigation of jest-community/vscode-jest#894. The culprit seems to be in TestScheduler where it catches runner exception and rethrow if it's in watch mode and not interrupted.
It didn't seem right as this resulted in reporters not knowing what is happening: it received the onRunStart
but nothing else afterward. It is also inconsistent that other watch mode runs that are always reported with (onRunStart
, onRunComplete
) pair. It seems we could capture this error in TestResult.testExecError
and report it via onRunComplete
.
I could write a PR if you agree with the fix.
EnvironmentSystem: OS: macOS 12.5.1 CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz Binaries: Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm npmPackages: jest: ^28.1.3 => 28.1.3
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4