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 test freeze, but works with vim-test

See original GitHub issue

Typescript, jest Running a test freeze

Running it directly with vim-test works properly.

image

Log:

...
20:45:01 | DEBUG | Thread-1 | __init__.py:_handle_coroutine:78 | Finished job with group update_positions
20:45:07 | INFO | MainThread | __init__.py:run_nearest:125 | Running nearest test in src/pipes/tests/PipeForm.test.tsx at line 55
20:45:07 | DEBUG | MainThread | __init__.py:_register_started:281 | Registering should_render_form,_header_and_submit_button-4681889750434716771 as started
20:45:07 | DEBUG | Thread-1 | __init__.py:_handle_coroutine:58 | Starting job with group should_render_form,_header_and_submit_button-4681889750434716771
20:45:07 | DEBUG | Thread-1 | processes.py:run:50 | Starting test process should_render_form,_header_and_submit_button-4681889750434716771 with command ['node_modules/.bin/react-scripts', 'test', '-t', '^<PipeForm> should render form, header and submit button$', 'src/pipes/tests/PipeForm.test.tsx'], cwd = None, env = None
20:45:08 | DEBUG | Thread-3 | handle.py:forward:85 | Writing data to output file
20:45:08 | DEBUG | Thread-3 | handle.py:forward:85 | Writing data to output file
20:45:08 | DEBUG | Thread-3 | handle.py:forward:85 | Writing data to output file
20:45:08 | DEBUG | Thread-3 | handle.py:forward:85 | Writing data to output file
20:45:08 | DEBUG | Thread-3 | handle.py:forward:85 | Writing data to output file
20:45:08 | DEBUG | Thread-3 | handle.py:forward:85 | Writing data to output file
...

Log indicates running: [‘node_modules/.bin/react-scripts’, ‘test’, ‘-t’, ‘^<PipeForm> should render form, header and submit button$’, ‘src/pipes/tests/PipeForm.test.tsx’], cwd = None, env = None

Running this command manually works properly: node_modules/.bin/react-scripts test -t '^<PipeForm> should render form, header and submit button$' src/pipes/tests/PipeForm.test.tsx

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rebuiltcommented, Aug 17, 2021

@smichaud Thank you. I was having the same issue. This helped me solve it.

0reactions
smichaudcommented, Jun 25, 2021

Nice! For anybody else having the same problem, the runner is actually reactscripts, so I added this to my init.vim

let test#javascript#reactscripts#options = "--watchAll=false"
let test#javascriptreact#reactscripts#options = "--watchAll=false"
let test#typescript#reactscripts#options = "--watchAll=false"
let test#typescriptreact#reactscripts#options = "--watchAll=false"

No sure they are all required but 🤷‍♂️…

The ability to add arguments to commands is honestly “candy/nice-to-have”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest tests run ok locally but freeze in Jenkins - only work with
I have a suite of Jest tests that work ok running jest locally - but when it runs just jest in Jenkins it...
Read more >
Jest freezing after tests run in Node 11 · Issue #7282 - GitHub
Bug Report I have normal quite big test file that work fine in node 10 but is freezing in 11 after printing: Ran...
Read more >
Troubleshooting - Jest
Use this guide to resolve issues with Jest. Tests are Failing and You Don't Know Why​. Try using the debugging support built into...
Read more >
Running tests with vim-test - Dev Log
This setup already provides all the configuration to run the tests with e.g. :TestNearest , but you will not see much of the...
Read more >
Runner hangs sometimes after all Jest tests are completed
I use GitLab cloud CI to run Jest tests on my node project and after deploy the app to AWS. It happened now...
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