0

I've installed gulp-npm-test following their documentation, that is, in my gulp directory I've got a file test.js that looks like this:

var gulp = require('gulp')
require('gulp-npm-test')(gulp)

var gulp = require('gulp-npm-test')(gulp, {
  withoutNpmRun: false
})

But when I run gulp test I get the output like the following:

[17:12:41] Using gulpfile ~/my-project/gulpfile.js
[17:12:41] Starting 'test'...

> my-project@0.0.1 test /Users/wogsland/my-project
> jest

 PASS  frontend/tests/components/atoms/InputText.test.js
 .
 .
 (many more Jest test passes, no fails)
 .
 .
 FAIL  gulp/tasks/test.js
  ● Test suite failed to run

    Your test suite must contain at least one test.

      at onResult (node_modules/jest/node_modules/jest-cli/build/TestRunner.js:192:18)

Test Suites: 1 failed, 135 passed, 136 total
Tests:       135 passed, 135 total
Snapshots:   209 passed, 209 total
Time:        92.237s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

What am I missing here? I've go a bunch of tests

wogsland
  • 9,106
  • 19
  • 57
  • 93

1 Answers1

1

Looks like the matcher that figures out which files are tests, matches everything that includes in the filename test.js. The default is [ '**/__tests__/**/*.js?(x)', '**/?(*.)(spec|test).js?(x)' ]. So either adapt this one, its testMatch in your jest settings. Or use testPathIgnorePatterns to exclude the /gulp folder.

Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297