jest-worker and typescript unexpected behavior
See original GitHub issue🐛 Bug Report
Jest tests fail with this error:
Call retries were exceeded
at ChildProcessWorker.initialize (node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)
...
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
To Reproduce
Using jest
and @babel/preset-typescript
, and jest-worker
, create a test which creates a new jest-worker which invokes a typescript definition.
Expected behavior
The typescript worker is run without error and the result returned to the test
Link to repl or repo (highly encouraged)
Repro is here: https://github.com/tedconn/worker-jest-ts
I was actually trying to repro a different issue but when trying to come up with a repro I would have expected this simple case to work!
envinfo
System:
OS: macOS 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 12.9.0 - ~/.nvm/versions/node/v12.9.0/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.10.2 - ~/.nvm/versions/node/v12.9.0/bin/npm
npmPackages:
jest: ^24.9.0 => 24.9.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
jest-worker - npm
Module for executing heavy tasks under forked processes in parallel, by providing a `Promise` based interface, minimum overhead, ...
Read more >Jest encountered an unexpected token when working with ...
Jest encountered an unexpected token This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not...
Read more >jest-worker unexpected token - You.com | The AI Search ...
I am using ts-jest to test my typescript library. When I run jest, I get the following error: Jest encountered an unexpected token...
Read more >jest-worker | Yarn - Package Manager
Module for executing heavy tasks under forked processes in parallel, by providing a Promise based interface, minimum overhead, and bound workers. readme. jest-...
Read more >How I Fixed The Unexpected Token Error In Jest
Some of the people posting their approaches seem quite knowledgeable on all aspects of configuration for Jest / React / Babel / TypeScript...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could you add a readme to the reproduction with which commands to run in order to reproduce the bug, and describe what behaviour you expected?
Thanks for the follow up.
I can contribute that.