简体   繁体   中英

Can´t run tests with “npm test”

I have this exercises, and a test file, and when a want to run that test I got this...

00-IntroToCS/homework (master)       
$ npm test

> prep@1.0.0 test 00-IntroToCS\homework
> jest --collectCoverage=false CS.test.js

No tests found
In 00-IntroToCS\homework
  5 files checked.
  testMatch: **/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x) - 1 match
  testPathIgnorePatterns: \\node_modules\\ - 5 matches
Pattern: CS.test.js - 0 matches
npm ERR! Test failed.  See above for more details.

I dont know too much about npm yet, this is a homework from a Bootcamp and I want to run the test file.

whats in your package.json file under the scripts section?

also try using

npm test -- SomeTestFileToRun

if youre just testing one file.

I found the solution: The problem was the directory: PROGRAMA CION(16-12-20)\HENRY (08-02-21) , the white spaces were the problem...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM