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.

Test does not run in CRA

See original GitHub issue

Hello! I am trying to set up the plugin with a React app from CRA. I have the plugin installed in VSCode and I have followed the configuration instructions in the README. I do see the “Run” and “Debug” options in my test file. However when I click “Run” nothing happens, it seems that the tests never really get started.

Here is my extension configuration:

# "jestrunner.jestCommand"
npm run test --

The target definition:

# package.json
"test": "react-scripts test",

Output seen in terminal:

me@mymachine web % cd '/Users/me/src/foo-app/web'
npm run test -- '/Users/me/src/foo-app/web/src/hooks/useTheStuff.spec.js' -c '/Users/me/src/foo-app/web/jest.config.js' -t 'useTheStuff%
me@mymachine web % npm run test -- '/Users/me/src/foo-app/web/src/hooks/useTheStuff.spec.js' -c '/Users/me/src/foo-app/web/jest.config.js' -t 'useTheStuff renders'

> foo-app-web@0.1.0 test /Users/me/src/foo-app/web
> react-scripts test "/Users/me/src/foo-app/web/src/hooks/useTheStuff.spec.js" "-c" "/Users/me/src/foo-app/web/jest.config.js" "-t" "useTheStuff renders"

Usage: test.js [--config=<pathToConfigFile>] [TestPathPattern]

Options:
  --help, -h                    Show help                              [boolean]
  --version, -v                 Print the version and exit             [boolean]
... rest of content omitted ...

I am on version v0.4.44.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
firsttriscommented, Sep 22, 2022

okay i reverted it.

0reactions
ianldgscommented, Sep 23, 2022

I have updated to 0.4.57 and can confirm this no longer happens. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running CRA Jest in non-interactive mode - Stack Overflow
CRA looks for a CI environment variable, if its present it doesn't run in watch mode. CI=true npm test should do what you...
Read more >
Running Tests | Create React App
The test command will force Jest to run in CI-mode, and tests will only run once instead of launching the watcher. For non-CI...
Read more >
Testing devices for COVID-19: Overview - Canada.ca
Health Canada has updated the list of COVID-19 testing devices that no longer have an urgent public health need status.
Read more >
Run react-script tests without watch - Marcusoft.net
The problem is that no change has been made, and I still want to rerun all the tests. Force it to run, so...
Read more >
React app testing: Jest and React Testing Library
React Testing Library is not an alternative to Jest. ... Jest is a test runner that finds tests, runs the tests, and determines...
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