question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
SimenBcommented, Aug 24, 2019

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?

0reactions
tedconncommented, Aug 28, 2019

Thanks for the follow up.

I can contribute that.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found