Jest pattern "" - 0 matches (switch from joke 19 & # 8594; joke 20)

I use the following jest.unittest.json file (used via jest -config):

{ "bail": false, "verbose": true, "transform": { "^.+\\.(ts|tsx)$": "typescript-babel-jest" }, "testPathIgnorePatterns": [ "<rootDir>/lib", "<rootDir>/lib_es6", "/node_modules/", "fixtures.ts", "/fixtures/" ], "moduleFileExtensions": [ "js", "jsx", "ts", "tsx", "node" ], "roots": [ "<rootDir>/src/__unittests__/Logger", "<rootDir>/src/__unittests__/Renderer/renderer.test.ts" ], "testRegex": "<rootDir>/src/__unittests__/.*\\.test.(ts|tsx|js|jsx)$" } 

Please note that the test files are: src / unittests /Renderer/renderer.test.ts, etc.

It worked before jest v19, but after upgrading to v20 this configuration no longer works.

When I joke --config jest.unittest.json --verbose, I get:

Pattern: "" - 0 matches

Is there something wrong with my configuration?

+5
source share
1 answer

Try changing testRegex to something like this:

"(/src/__unittests__/.*|\\.(test|spec))\\.(ts|tsx|js)$"

0
source

Source: https://habr.com/ru/post/1268468/


All Articles