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.

Unit tests are not executed

See original GitHub issue

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

I am using latest yarn 0.27.5 and npm 5.2.0 on Windows.

Environment

  • Node 8.1.3
  • Yarn 0.27.5 or NPM 5.2.0
  • react-scripts@1.0.1
  • Windows

Steps to Reproduce

  1. Run yarn test or npm test (is running script react-scripts test --env=jsdom)

  2. It says: “Determining test suites to run…” -> “Press a to run all tests.”

  3. After hitting a

  4. You see:

No tests found
In C:\PROJECT
  18490 files checked.
  testMatch: C:\PROJECT\src\**\__tests__\**\*.js?(x),C:\PROJECT\src\**\?(*.)(spec|test).js?(x) - 6 matches
  testPathIgnorePatterns: \\node_modules\\ - 18490 matches
Pattern: "" - 0 matches

No tests were executed but there are tests inside in PROJECT/src/ eg. default App.test.js - these tests are being executed when saving changes while in jest watch mode.

Expected Behavior

All tests inside src/**/*.test.js should be executed

Note (Temporary workaround)

Using Windows 10 bash (ubuntu) it’s running fine, so looks like it affects only Windows (tested on both - Win 7 & 10)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
gaearoncommented, Jan 9, 2018

Seems like this is fixed on Jest 22 so I’ll close. We’ll update to it soon.

As a temporary workaround you can run your tests with --no-watchman, i.e. npm test -- --no-watchman.

3reactions
zehbauercommented, Oct 17, 2017

Hi, I solved this issue by removing the locally installed watchman path variable. When running jest --verbose I got “@providesModule naming collision” warnings as reported in issue. After removing the variable, jest is matching and executing all tests again. Maybe this workaround helps some of you. My system is running:

  • Microsoft Windows 10 Enterprise (x64)
  • Version 10.0.15063 Build 15063
Read more comments on GitHub >

github_iconTop Results From Across the Web

Tests not running in Test Explorer - visual studio
However, the tests are not running when using the Visual Studio test explorer. The Test Explorer is showing all unit tests, but once...
Read more >
NUnit tests are not executed in Test Explorer
Trying to run each of them, or running all results in all of them appearing "greyed out" and nothing is being executed. Not...
Read more >
How To Resolve Issue Of Test Project Not Running The Unit ...
Two of my test projects didn't run the test cases, it was about to start and took some time to run the test...
Read more >
Tests not running in Visual Studio - Developers Log
Test are showing in the Visual Studio test explorer window, but they are not running: how to solve this issue.
Read more >
Visual Studio 2019: MSTest unit tests are not running in Test ...
Right-click on your test project · Click Manage Nuget Packages… · Browse > search for MSTest.TestAdapter > click on MSTest.TestAdapter in the ...
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