Add test coverage for empty suite handling

This commit is contained in:
ragaskar 2009-08-20 19:32:15 -07:00
parent 96bcde80af
commit 9b9a4b6835
1 changed files with 43 additions and 14 deletions

View File

@ -791,7 +791,7 @@ describe("jasmine spec running", function () {
expect(firstSpecHasRun).toEqual(true); expect(firstSpecHasRun).toEqual(true);
expect(secondSpecHasRun).toEqual(true); expect(secondSpecHasRun).toEqual(true);
}); });
it("testBeforeExecutesSafely", function() { it("testBeforeExecutesSafely", function() {
var report = ""; var report = "";
@ -965,6 +965,35 @@ describe("jasmine spec running", function () {
expect(nestedSpec.getFullName()).toEqual('Test Subject when under circumstance A and circumstance B behaves thusly.'); //, "Spec.fullName was incorrect: " + nestedSpec.getFullName()); expect(nestedSpec.getFullName()).toEqual('Test Subject when under circumstance A and circumstance B behaves thusly.'); //, "Spec.fullName was incorrect: " + nestedSpec.getFullName());
}); });
it("should skip empty suites", function () {
env.describe('NonEmptySuite1', function() {
env.it('should pass', function() {
this.expect(true).toEqual(true);
});
env.describe('NestedEmptySuite', function() {
});
env.it('should pass', function() {
this.expect(true).toEqual(true);
});
});
env.describe('EmptySuite', function() {});
env.describe('NonEmptySuite2', function() {
env.it('should pass', function() {
this.expect(true).toEqual(true);
});
});
env.execute();
fakeTimer.tick(0);
var runnerResults = env.currentRunner.getResults();
expect(runnerResults.totalCount).toEqual(3);
expect(runnerResults.passedCount).toEqual(3);
expect(runnerResults.failedCount).toEqual(0);
});
it("should bind 'this' to the running spec within the spec body", function() { it("should bind 'this' to the running spec within the spec body", function() {
var spec; var spec;
var suite = env.describe('one suite description', function () { var suite = env.describe('one suite description', function () {