* Removed old Queue & Runner in favor of Suite using the new QueueRunner

* New reporter interface across all reporters
* xdescribe & xit now store disabled specs
* Rewrite of HtmlReporter to support new interface and be more performant
This commit is contained in:
Davis W. Frank
2012-12-10 22:43:03 -08:00
committed by Dan Hansen and Davis W. Frank
parent 05977203a6
commit 3fc79bac9e
43 changed files with 3229 additions and 3318 deletions

View File

@@ -1,3 +1,4 @@
// TODO: This should really be part of the Env Integration Spec
describe("jasmine spec running", function () {
var env;
var fakeTimer;
@@ -74,11 +75,11 @@ describe("jasmine spec running", function () {
var actions = [];
env.beforeEach(function () {
actions.push('runner beforeEach');
actions.push('topSuite beforeEach');
});
env.afterEach(function () {
actions.push('runner afterEach');
actions.push('topSuite afterEach');
});
env.describe('Something', function() {
@@ -131,33 +132,33 @@ describe("jasmine spec running", function () {
var expected = [
"runner beforeEach",
"topSuite beforeEach",
"outer beforeEach",
"outer it 1",
"outer afterEach",
"runner afterEach",
"topSuite afterEach",
"runner beforeEach",
"topSuite beforeEach",
"outer beforeEach",
"inner 1 beforeEach",
"inner 1 it",
"inner 1 afterEach",
"outer afterEach",
"runner afterEach",
"topSuite afterEach",
"runner beforeEach",
"topSuite beforeEach",
"outer beforeEach",
"outer it 2",
"outer afterEach",
"runner afterEach",
"topSuite afterEach",
"runner beforeEach",
"topSuite beforeEach",
"outer beforeEach",
"inner 2 beforeEach",
"inner 2 it",
"inner 2 afterEach",
"outer afterEach",
"runner afterEach"
"topSuite afterEach"
];
expect(actions).toEqual(expected);
});
@@ -219,16 +220,30 @@ describe("jasmine spec running", function () {
expect(actions).toEqual(expected);
});
it("shouldn't run disabled suites", function() {
var specInADisabledSuite = originalJasmine.createSpy("specInADisabledSuite"),
suite = env.describe('A Suite', function() {
env.xdescribe('with a disabled suite', function(){
env.it('disabled spec', specInADisabledSuite);
});
});
suite.execute();
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').runs(disabledSpec);
env.xit('disabled spec', disabledSpec);
});
suite.execute();
expect(disabledSpec).not.toHaveBeenCalled();
});
it("should recover gracefully when there are errors in describe functions", function() {
// TODO: is this useful? It doesn't catch syntax errors
xit("should recover gracefully when there are errors in describe functions", function() {
var specs = [];
var superSimpleReporter = new jasmine.Reporter();
superSimpleReporter.reportSpecResults = function(result) {
@@ -275,5 +290,4 @@ describe("jasmine spec running", function () {
));
});
});
});