Support pending specs with:
- xit
- it with a null function body ( it("should be pending");
- calling pending() inside a spec
- having a spec without any expectations
Pending and Filtered specs now call Reporter interface specStarted so that reporting acts as expected.
Pending and Filtered spec names are present and styled in the HTML reporter
Using xit used to disable a spec. Disabling is now just when a spec is filtered out at run time (usually w/ the reporter).
Suites are still disabled with xdescribe and means its specs are never executed.
This commit is contained in:
@@ -224,7 +224,7 @@ describe("jasmine spec running", function () {
|
||||
var specInADisabledSuite = originalJasmine.createSpy("specInADisabledSuite"),
|
||||
suite = env.describe('A Suite', function() {
|
||||
env.xdescribe('with a disabled suite', function(){
|
||||
env.it('disabled spec', specInADisabledSuite);
|
||||
env.it('spec inside a disabled suite', specInADisabledSuite);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -233,15 +233,18 @@ describe("jasmine spec running", function () {
|
||||
expect(specInADisabledSuite).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("shouldn't run disabled tests", function() {
|
||||
var disabledSpec = originalJasmine.createSpy('disabledSpec'),
|
||||
suite = env.describe('default current suite', function() {
|
||||
env.xit('disabled spec', disabledSpec);
|
||||
});
|
||||
it("should set all pending specs to pending when a suite is run", function() {
|
||||
var pendingSpec,
|
||||
suite = env.describe('default current suite', function() {
|
||||
pendingSpec = env.it("I am a pending spec");
|
||||
});
|
||||
|
||||
suite.execute();
|
||||
expect(disabledSpec).not.toHaveBeenCalled();
|
||||
|
||||
expect(pendingSpec.status()).toBe("pending");
|
||||
});
|
||||
|
||||
|
||||
// TODO: is this useful? It doesn't catch syntax errors
|
||||
xit("should recover gracefully when there are errors in describe functions", function() {
|
||||
var specs = [];
|
||||
|
||||
Reference in New Issue
Block a user