Can't make it work with Angular CLI and custom Jest builder.
See original GitHub issueEnvironment
node -v
: v8.12.0npm -v
: 6.4.1npm ls jest
ornpm ls react-scripts
(if you haven’t ejected):npm ls jest
:
`-- jest@23.6.0
-
your vscode-jest settings if customized:
- jest.pathToJest:
npm test --
- anything else that you think might be relevant?
- jest.pathToJest:
-
Operating system: Windows 10
Prerequisite
- are you able to run jest test from command line? Yes.
- how do yo run your tests from command line?
npm run test
ng test
Steps to Reproduce
// TODO
Relevant Debug Info
spawning process with command=npm, args=test,--,--json,--useStderr,--outputFile,C:\Users\MICHAE~1.DEA\AppData\Local\Temp/jest_runner.json,--no-color
> ng test --watch "--json" "--useStderr" "--outputFile" "C:\Users\SuperCoolUserName\AppData\Local\Temp/jest_runner.json" "--watch" "--no-color"
Expected Behavior
I would expect this to use the configuration from the Angular builder and work.
Actual Behavior
Prints:
No tests found related to files changed since last commit.
Considerations:
I’m using Angular CLI, with Jest configured through @angular-builders/jest
package. From command line works as expected using both npm run test
, and ng test --watch
(npm run test
is an alias for the latter). From the npm script panel in VSCode it launches as expected.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:22
Top Results From Across the Web
@angular-builders/jest - npm
Jest runner for Angular build facade. Allows ng test run with Jest instead of Karma. Latest version: 15.0.0, last published: 6 days ago....
Read more >Angular CLI builders
With Angular version 8, the CLI Builder API is stable and available to developers who want to customize the Angular CLI by adding...
Read more >Angular CLI - unable to use custom environment file for testing
I try to run ng test with a specific flag configured in custom environment file. My @angular/cli version is 8.3.21. My first attempt...
Read more >Angular CLI: “ng test” with Jest in 3 minutes - Just Jeb
The builder supports multi-projects workspaces by default, the only thing you have to do is to modify each project's tsconfig.spec.json as ...
Read more >Supported technologies: Angular, Angular CLI - Wallaby.js
When using Automatic Configuration to run tests for the entire workspace, Wallaby creates merged virtual copies of test.ts , polyfills.ts and tsconfig.spec.json ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh! I get now what you mean with auto watch. I think you could try to get it working with a workspace. You can setup each app and lib into its own project in the workspace, and configure each. I have a repo with Lerna, but it’s private for now. I’ll try to upload a example with a clean repo.
Yea; I can’t get your launch.json to work for me; but I created my own that works great with nx. nx is a single repo; but multiple projects; so it’s useful to scope debugging to just the tests on a single library or app rather than the whole thing; which is whay my launch.json does as documented in this gist: https://gist.github.com/toddwseattle/71f1c2b7b439c6523cc543edab030842
What I would like is a way for the auto watch to work so things like the inline red / green dots work; and that I don’t get the problems tabbed filled with un running tests.