Issue
I have Angular2 project build with Angular-CLI (beta 20).
Is there a way to run tests against only one selected spec file?
I used to have a project based on Angular2 quick start, and I could manually add specs to jasmine file. But I don't know how to set this up outside of karma testing or how to limit karma tests to specific files with Angular-CLI builds.
Solution
Each of your .spec.ts file have all its tests grouped in describe block like this:
describe('SomeComponent', () => {...}
You can easily run just this single block, by prefixing the describe function name with f:
fdescribe('SomeComponent', () => {...}
If you have such function, no other describe blocks will run.
Btw. you can do similar thing with it => fit and there is also a "blacklist" version - x. So:
fdescribeandfitcauses only functions marked this way to runxdescribeandxitcauses all but functions marked this way to run
Answered By - Tomek SuĊkowski
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.