As the title says, I would like to run a single test, not the whole spec. The naive way I tried was using a case like this:
describe("MyCase",function() {
it("has a test",function() {
expect(something).toBe(something);
}
it("has another test",function() {
expect(something_else).toBe(something_else);
}
}
This is saved in a file called MyCase.spec.js (if this matters). I would have thought that it would be possible to run just the first case using the following from the command line:
jasmine-node --match="MyCase has a test"
But this is apperantly not the way to do it. So how is it done?
Thanks!
it may be pretty old channel but it would help someone who is looking for running specific testcase with jasmine 2.0. Use "fdescribe" to run a specific suite and use "fit" to run a specific spec.This skips all other tests except marked.
keep an eye and not to commit fdescribe and fit to repo. Here f describe the "focus".
For lower versions we can use ddescribe, iit as described in upper answers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With