firsttris / vscode-jest-runner

Simple way to run or debug one or more tests from context menu, codelens or command plalette
https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner
MIT License
265 stars 124 forks source link

File not found: <rootDir>/tsconfig.spec.json #251

Closed derek90 closed 2 years ago

derek90 commented 2 years ago

When running a single test using the extension in an Angular project, it fails returning the following error: File not found: <rootDir>/tsconfig.spec.json In my project, the proper file path is <rootDir>/src/tsconfig.spec.json, so I need to tell Jest Runner where to find it but I didn't figure that out yet. Is it possible? How?

derek90 commented 2 years ago

I'm closing this issue because is not a bug. I solved it adding a property in <rootDir>/jest.config.js like this:

module.exports = {
    // ...
    globals: {
        'ts-jest': {
            tsconfig: '<rootDir>/src/tsconfig.spec.json'
        }
    }
};