Comments (5)
Just throwing in my Jest config, I don't know Jest well enough to know if this is good/bad/invalid or otherwise. But obviously, it might well be something here causing the issue. Unfortunatly, I don't know how to strip it down to a minimal config, but I'll gladly test anything if it helps.
"jest": {
"globals": {
"ts-jest": {
"useBabelrc": false
}
},
"verbose": true,
"collectCoverage": true,
"collectCoverageFrom": [
"ClientApp//*.tsx",
"ClientApp//*.ts"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/tests/common/",
"/ClientApp/typings/",
"/ClientApp/boot.tsx",
"/ClientApp/appstate.tsx",
"/ClientApp/routes.tsx",
],
"transform": {
"^.+\.tsx?$": "ts-jest",
"^.+\.ts?$": "ts-jest"
},
"testRegex": "((\.|/)(test|spec))\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"moduleNameMapper": {
"\.(css|scss)$": "/mocks/styleMock.js"
},
"modulePathIgnorePatterns": [],
"setupFiles": [
"/tests/setup.js"
]
}
from vscode-jest-runner.
Hey @iPlexor
you do not even have to select the text you can just right click between - it('clicksomewherehere') (also works for describe)
what the addon basically does is it runs "jest -t testNamePattern".
--testNamePattern, -t
Run only tests with a name that matches the regex pattern. [string]
i tested with an project where some tests fail:
jest
=>
Test Suites: 6 failed, 7 passed, 13 total
Tests: 19 failed, 104 passed, 123 total
jest -t 'ComplainCollection Test'
=>
PASS packages/server/src/collections/ComplainCollection.test.ts
Test Suites: 12 skipped, 1 passed, 1 of 13 total
Tests: 122 skipped, 1 passed, 123 total
Snapshots: 0 total
Time: 3.678s
Ran all test suites with tests matching "ComplainCollection Test".
from vscode-jest-runner.
//jest.config.js
module.exports = {
"moduleDirectories": [
"node_modules",
"packages/common",
"packages/app/src"
],
"globals": {
"ts-jest": {
"tsConfigFile": "tsconfig.json"
}
},
"clearMocks": true,
"resetMocks": true,
"collectCoverageFrom": [
"/server/src/",
"/app/src/actions/",
"/app/src/reducers/"
],
"testRegex": "(/tests/.*|\.(test|spec))\.(ts|tsx|js)$",
"setupFiles": [
"/jest/shim.js",
"/jest/setup.js"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/dist/",
"/coverage/",
"/webpack/"
],
"transformIgnorePatterns": [
"/node_modules/",
"/dist/",
"/coverage/",
"/webpack/"
],
"watchPathIgnorePatterns": [
"/node_modules/",
"/dist/",
"/coverage/",
"/webpack/"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jest"
],
"moduleNameMapper": {
"\.(css|less)$": "identity-obj-proxy"
},
"transform": {
"\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/jest/fileTransformer.js",
"^.+\.(ts|tsx)$": "/node_modules/ts-jest/preprocessor.js"
}
}
from vscode-jest-runner.
Thanks for the reply and for creating the extension. 👍
I understand how it's asking node to execute jest with the -t 'testNamePattern' and I raised a seperate issue as I realised why I had to select the test name now.
I think the test suites which fail only fail because they have no tests matching the testNamePattern to execute. The suites do contain tests, but none that match the test name provided. So unless the extension is somehow causing those empty suites to run I think the issue must be with Jest itself not realising it can skip the empty suites and reporting them as failed.
from vscode-jest-runner.
please reopen if issue still exists
from vscode-jest-runner.
Related Issues (20)
- Add fileextensions for modules as default HOT 2
- Breaks when ts file contains `using` keyword HOT 3
- Support cwd of current package inside monorepo HOT 5
- Default jest config file resolution not supported HOT 1
- Simple test explorer? HOT 3
- Becoming a contributor HOT 1
- Running tests with function or variable inside the name are not found HOT 2
- Cannot use import satement outside a module HOT 5
- Idea: Simplify Debug Mode HOT 2
- Please stop removing Run | Debug when there is an error in the unit test file HOT 7
- Debugger does not work in 1.88 HOT 6
- VS Code Test Coverage API HOT 1
- Cannot debug from jest test in vscode on M2 mac silicon
- Debugging ESM works but not Running HOT 1
- Extension crashing again
- Exclude extension from certain subdirectories in monorepo HOT 1
- Clears output from all integrated terminals
- debug mode doesn't respect unchecked "Change Directory To Workspace Root"
- Using computable names in the jest describe/it results in Jest Runner not picking up the test
- Support multiple entries in jestrunner.configPath
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-jest-runner.