Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No tests found on Windows with Jenkins #5935

Open
Saibamen opened this issue Nov 30, 2018 · 12 comments
Open

No tests found on Windows with Jenkins #5935

Saibamen opened this issue Nov 30, 2018 · 12 comments

Comments

@Saibamen
Copy link

Saibamen commented Nov 30, 2018

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

test

Environment

From npx create-react-app --info:
(node:2604) UnhandledPromiseRejectionWarning: Error: The system cannot find the path specified.

System:
OS: Microsoft Windows Version 10.0.14393
CPU: x64 Intel(R) Xeon(R) CPU E5-2420 0 @ 1.90GHz
Binaries:
Node: 10.13.0
npm: 6.4.1
npmPackages:
"@coreui/coreui": "^2.1.1",
    "@coreui/icons": "0.3.0",
    "@coreui/react": "^2.1.0",
    "bootstrap": "^4.1.3",
    "classnames": "^2.2.6",
    "flag-icon-css": "^3.2.1",
    "font-awesome": "^4.7.0",
    "node-sass": "^4.10.0",
    "prop-types": "^15.6.2",
    "react": "^16.6.1",
    "react-dom": "^16.6.1",
    "react-helmet": "5.2.0",
    "react-loadable": "^5.5.0",
    "react-redux": "^5.1.0",
    "react-router-bootstrap": "^0.24.4",
    "react-router-dom": "^4.3.1",
    "react-router-redux": "^5.0.0-alpha.8",
    "react-scripts": "2.1.1",
    "reactstrap": "^6.5.0",
    "redux": "^4.0.1",
    "redux-immutable": "4.0.0",
    "redux-thunk": "^2.3.0",
    "rimraf": "^2.6.2",
    "simple-line-icons": "^2.4.1"

Steps to Reproduce

  1. Write test file and save it in src folder as App.test.js
  2. npm run react-scripts test --env=jsdom --no-watchman
    or
  3. npm react-scripts test --env=jsdom --coverage

Reproduction repository: https://github.com/Saibamen/react_test

Expected Behavior

Tests should be executed

Actual Behavior

No tests found

react-scripts test --env=jsdom --no-watchman
00:02:06.736 
00:02:11.011 No tests found
00:02:11.011 In C:\Program Files (x86)\Jenkins\workspace\xxx\src\Web\xxx.Web\ClientApp
00:02:11.011   50 files checked.
00:02:11.011   testMatch: C:\Program Files \(x86\)\Jenkins\workspace\xxx\src\Web\xxx.Web\ClientApp\src\**\__tests__\**\*.{js,jsx,ts,tsx},C:\Program Files \(x86\)\Jenkins\workspace\xxx\src\Web\xxx.Web\ClientApp\src\**\?(*.)(spec|test).{js,jsx,ts,tsx} - 0 matches
00:02:11.011   testPathIgnorePatterns: \\node_modules\\ - 50 matches
00:02:11.011 Pattern:  - 0 matches
00:02:11.045 npm ERR! code ELIFECYCLE
00:02:11.046 npm ERR! errno 1
00:02:11.048 npm ERR! xxx@0.1.0 test:ci: `react-scripts test --env=jsdom --no-watchman`
00:02:11.049 npm ERR! Exit status 1
00:02:11.049 npm ERR! 
00:02:11.049 npm ERR! Failed at the xxx@0.1.0 test:ci script.
00:02:11.050 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
00:02:11.086 
00:02:11.087 npm ERR! A complete log of this run can be found in:
00:02:11.087 npm ERR!     C:\Users\jenkins\AppData\Roaming\npm-cache\_logs\2018-11-30T12_24_24_901Z-debug.log
00:02:11.109 Build step 'Execute Windows batch command' marked build as failure
@Saibamen
Copy link
Author

Saibamen commented Dec 3, 2018

Reproduction repository: https://github.com/Saibamen/react_test

@johnbowdenatfacet
Copy link

johnbowdenatfacet commented Dec 23, 2018

Having the same issue.

@Saibamen
Copy link
Author

Saibamen commented Jan 7, 2019

Still failing with 2.1.3

@stale
Copy link

stale bot commented Feb 9, 2019

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Feb 9, 2019
@Saibamen
Copy link
Author

activity mode on :P

@stale stale bot removed the stale label Feb 10, 2019
@nmklotas
Copy link

nmklotas commented Apr 5, 2019

Same happens to me with 2.1.8

@Ryan8765
Copy link

Also running into the same issue.

@sheerun
Copy link
Contributor

sheerun commented Sep 20, 2019

still happens...

@SalahMadih
Copy link

SalahMadih commented Apr 8, 2020

Install yarn globally in your stages work for me,

stages {
stage('Prepare') {
steps {
sh "npm install -g yarn"
}
}

      stage("Unit test") {
           steps {
                echo 'Testing..'
                sh 'yarn run test --watchAll'
           }
      }

}

@ajo8571
Copy link

ajo8571 commented Jun 7, 2021

has there been a fix for this?

@magua-io
Copy link

magua-io commented Feb 1, 2023

Ran into the same issue on Windows Jenkins today. Any fix or update for this?

@magua-io
Copy link

magua-io commented Feb 2, 2023

This works for me: https://stackoverflow.com/questions/60604572/react-jest-no-tests-found-exiting-with-code-0

I used yarn test --watchAll=false --testMatch **/src/**/*.test.js on Windows Jenkins, and it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants