G
G
GaserV2019-01-14 16:24:56
React
GaserV, 2019-01-14 16:24:56

Why doesn't JEST see tests?

Jest doesn't see tests. Maybe the regex isn't working? The name of the test of the form my-component.spec.ts which I already put right in the root of __tests_. And still he doesn't see.

module.exports = {
    roots: ["<rootDir>/src"],
    transform: {
        "^.+\\.tsx?$": "ts-jest"
    },
    testRegex: "/__tests__/.*.spec.tsx?$",
    moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"]
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GaserV, 2019-01-14
@GaserV

Fixed. Because I have __tests__ not in ./src but on the same level with this directory, then roots should look like roots: [""].

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question