Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
50
rated 0 times [  52] [ 2]  / answers: 1 / hits: 93965  / 7 Years ago, sat, june 24, 2017, 12:00:00

running docker mhart/alpine-node:8 on macOS with




nodejs (6.10.3-r0) (18/18)
yarn 0.24.6
jest 20.0.4




I have a __tests__/index.test.js file however, when running the code



node_modules/.bin/jest --watchAll I get the below output




No tests found

In /usr/src/app

5 files checked.

testMatch: /__tests__//*.js?(x),**/?(*.)(spec|test).js?(x) - 1 match

testPathIgnorePatterns: /node_modules/,/src,src - 0 matches

Pattern: - 0 matches




I've re-installed the package numbers times but to no avail.


More From » node.js

 Answers
20

Your output says that testMatch had 1 match, which may be your __tests__/index.test.js file. It seems that your testPathIgnorePatterns is causing that test suite to be ignored. No tests found In /usr/src/app says that Jest is looking for tests in /usr/src/app, and testPathIgnorePatterns: /node_modules/,/src,src says that Jest is ignoring files in /src directories.



Either point Jest to look at the location of your __tests__/index.test.js file if it is outside the /src directory, or stop testPathIgnorePatterns from ignoring the /src directory.


[#57310] Thursday, June 22, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
byrondonavanc

Total Points: 675
Total Questions: 107
Total Answers: 105

Location: Peru
Member since Fri, Oct 14, 2022
2 Years ago
byrondonavanc questions
;