In my team, most are able to run ‘npx jest’ and tests execute normally, both on Windows and MacOS clients. I seem to have an unusual issue, and hope someone has run into this same issue and might be able to shed some light on the problem. I have confirmed that the installed OS libraries match, and the jest.config.js is committed to our repository and is the same for everyone.
I think this might be path related, I have tried removing the ‘./’ prefix in jest.config.js, but tests still don’t run.
Any assistance is appreciated.
Here is the console output on MacOS Monterey 12.6
MACHINE: product-stencil user$ npx jest
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In /Users/user/git/tmp/product-stencil
3278 files checked.
testMatch: - 0 matches
testPathIgnorePatterns: ./tmp, ./src/test, ./styleguide, ./src/main/custom/ts, ./src/main/custom/dist - 0 matches
testRegex: (/__tests__/.*|\.?(test|spec))\.(ts|tsx|js|mjs|jsx)$ - 1030 matches
Pattern: - 0 matches
Here is the jest.config.js,
const config = {
preset: "@stencil/core/testing",
testRunner: "jest-jasmine2",
collectCoverage: true,
coverageReporters: ["json", "html"],
collectCoverageFrom: [
"./src/main/custom/stencil/**/*.{ts,tsx}"
],
coveragePathIgnorePatterns: [
"./node_modules/",
"./src/test/",
"./styleguide/",
"./src/main/custom/stencil/components.d.ts",
"./src/main/custom/ts/",
"./src/main/custom/dist/"
],
testPathIgnorePatterns: [
"./tmp",
"./src/test",
"./styleguide",
"./src/main/custom/ts",
"./src/main/custom/dist"
],
coverageDirectory: "./target/jest-coverage",
coverageThreshold: {
global: {
lines: 0
}
}
};
module.exports = config;