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 26.2.1 regression: “No tests found” on Windows

See original GitHub issue

🐛 Bug Report

In PostCSS we found a problem with the new Jest release. After updating Jest to 26.2.1, Jest stopped to see tests on Windows in our Travis CI.

$ npx jest

No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
No files found in C:\Users\travis\build\postcss\postcss.
Make sure Jest's configuration does not exclude this directory.
To set up Jest, make sure a package.json file exists.
Jest Documentation: facebook.github.io/jest/docs/configuration.html
Pattern:  - 0 matches
The command "npx jest" exited with 1.

To Reproduce

Seems like just call npx jest on Windows. Here is a config to call it on Travis CI

matrix:
  include:
    os: windows
    cache: false
    node_js: node
    script: npx jest
    env:
      - YARN_GPG=no

Expected behavior

https://travis-ci.org/github/postcss/postcss/jobs/713424784

Link to repl or repo (highly encouraged)

https://github.com/postcss/postcss/archive/8722140c5c55530b0c4091190f1557b42fd18c87.zip

envinfo

  System:
    OS: Windows 10 10.0.17763
    CPU: (2) x64 Intel(R) Xeon(R) CPU
  Binaries:
    Node: 14.7.0 - C:\ProgramData\nvs\node\14.7.0\x64\node.EXE
    Yarn: 1.22.4 - ~\.yarn\bin\yarn.CMD
    npm: 6.14.7 - C:\ProgramData\nvs\node\14.7.0\x64\npm.CMD
  npmPackages:
    jest: ^26.2.1 => 26.2.1 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:23 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
raviteja64commented, Jul 31, 2020

Tests not being detected on WIndows. I use yarn, ts-jest for typescript.

Do we have an interim solution for windows? Version is automatically being pointed to 26.2.1 even thought i explicitly mention ~26.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source - GitHub
jest 17.0.2 - Fixed performance regression in module resolution. ... Added a "no tests found" message if no tests can be found. -...
Read more >
Jest No Tests Found - FaqCode24.com
No tests found In /usr/src/app says that Jest is looking for tests in /usr/src/app ... Jest 26.2.1 regression: “No tests found” on Windows...
Read more >
jest - Jest 26.2.1回归:Windows上“未找到测试” | bleepcoder.com
$ npx jest No tests found, exiting with code 1 Run with `--passWithNoTests` to exit with code 0 No files found in C:\Users\travis\build\postcss\postcss....
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