Jest cannot find test files anymore

Viewed 470

I have multiple project with the same jest configuration.

In those projects, everything was working properly before the installation of some packages this morning.

I installed Android Studio, watchman react-native, autoconf ...

I tried with node 12 and node 14 but without success.

I am getting following errror:

No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
No files found in /home/bastio/projects/heyliot/back/function-app-iot-gateway/app.
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

jest.config.js

module.exports = {
    testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/__tests__/?.*/utils/.*", "<rootDir>/__tests__/dataset", "<rootDir>/tests/.*"],
    testMatch: ['<rootDir>/__tests__/**/*.test.js'],
    roots: [],
    setupFiles: ["./__tests__/utils/setEnvVars.js"],
    verbose: true
}

UPDATE: With or without the testMatch I have the same result.

My tree

jest.config.js
package.json
[...]
__tests__/
├── common
│   └── arrayHelper.test.js
├── dataset
│   ├── context.mock.js
│   ├── liveObjectHelper
│   │   ├── sensor_with_bad_net.json
│   │   └── sensor_with_dl_with_liveobject.json
│   ├── sensor_no_network_provider.json
│   ├── sensor_with_no_dls.json
│   ├── sensor_with_no_dls_sigfox.json
│   ├── uplink_first_manager.json
│   ├── uplink_first_manager_sigfox.json
│   ├── uplink_for_manager.json
│   └── uplink_that_match_sensor.json
├── payloadHTTP
│   ├── DefaultController.test.js
│   ├── heyWanesyTesterProvider.test.js
│   └── index.test.js
├── payloadManager
│   ├── DownlinkCounterManager.test.js
│   ├── index.test.js
│   └── liveObjectHelper.test.js
└── utils
    ├── context.mock.js
    └── setEnvVars.js

My package.json

{
  "name": "name",
  "version": "1.1.0",
  "description": "",
  "scripts": {
    "start": "func start",
    "jest": "jest",
  },
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "git@gitlab.com:heyliot/azure-functions.git"
  },
  "dependencies": {
...
  },
  "devDependencies": {
    "assert": "2.0.0",
    "chai": "4.2.0",
    "chai-exclude": "2.0.2",
    "jest": "^26.6.3",
    "mocha": "7.2.0",
    "nyc": "15.1.0",
    "proxyquire": "^2.1.3",
    "rewire": "5.0.0"
  }
}

0 Answers
Related