I have this jasmine test that I'm running with Karma:
describe('When a logged in user chooses Rent and Payment PIN is enabled', function() {
beforeEach(function(){
});
afterEach(function() {
});
it('should be presented with a dialog to enter the pin', function() {
//test to be skipped
})
})
And I want to see on report that this test has been skipped and come back to test when all stuff needed for test will be ready.
How can I accomplish this?
Excluding Tests / Specs If you want to exclude a specific test, simply use xit() instead of it() . The x means exclude. describe('description', function () { xit('description', function () {}); }); If you want to exclude an entire describe block, use xdescribe() instead of describe() .
Jasmine is a behavior-driven development framework for testing JavaScript code that plays very well with Karma. Similar to Karma, it's also the recommended testing framework within the Angular documentation as it's setup for you with the Angular CLI. Jasmine is also dependency free and doesn't require a DOM.
Specs. A spec declares a test case that belongs to a test suite. This is done by calling the Jasmine global function it() which takes two parameters, the title of the spec (which describes the logic we want to test) and a function that implements the actual test case.
You might try using the pending
function in your spec. According to the doc, pending specs don't run, but names still show up in the results. For 2.0, it also says an empty method body should work. Try:
it('should be presented with a dialog to enter the pin', function() {
pending();
})
or
it('should be presented with a dialog to enter the pin');
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