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

Jest-runner cannot recognize the test file that added from another Editor. #291

Open AnneJoJo opened 1 year ago

AnneJoJo commented 1 year ago

Recently I run into a issue that I create a new spec.ts as a test file for a certain ts code with InteliJ, but when I push my friends open it from vscode, jest-runner doesn't display the run/debug pin around the test. It seems fine when he created a new file from vscode to add those tests. I'm not sure if this is a bug or any config issue, because all tests work well in both editors. It seems not recognize the file/test block added from InteliJ.

our jest.config // jest.config.js module.exports = { preset: "react-native", testEnvironment: "node", // transformIgnorePatterns: [ // "node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community)", // ], moduleFileExtensions: ["js", "ts"], transform: { "^.+\.(js)$": "/node_modules/babel-jest", "\.(ts)$": "ts-jest", }, testPathIgnorePatterns: [ "/dist/", "/node_modules/", ], cacheDirectory: ".jest/cache", setupFilesAfterEnv: [ "./testSetup/NativeModules.js", "./testSetup/Global.js", "./testSetup/jest.setup.js",

], globals: { "ts-jest": { babelConfig: true, diagnostics: { ignoreCodes: [7041], }, }, }, };