Trivial Reporter improvements, runner now returns specs()
This commit is contained in:
@@ -13,11 +13,6 @@ describe("jasmine.Env", function() {
|
||||
expect(env.nextSpecId()).toEqual(2);
|
||||
});
|
||||
|
||||
it('nextSuiteId should return consecutive integers, starting at 0', function () {
|
||||
expect(env.nextSuiteId()).toEqual(0);
|
||||
expect(env.nextSuiteId()).toEqual(1);
|
||||
expect(env.nextSuiteId()).toEqual(2);
|
||||
});
|
||||
});
|
||||
describe("reporting", function() {
|
||||
var fakeReporter;
|
||||
|
||||
@@ -33,8 +33,8 @@ describe('RunnerTest', function() {
|
||||
|
||||
env.describe('suite 2', function () {
|
||||
env.it('test 2-1', function() {
|
||||
foo++;
|
||||
this.expect(foo).toEqual(1);
|
||||
foo++;
|
||||
this.expect(foo).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,9 +44,40 @@ describe('RunnerTest', function() {
|
||||
expect(runnerResults.totalCount).toEqual(3);
|
||||
expect(runnerResults.passedCount).toEqual(3);
|
||||
});
|
||||
|
||||
|
||||
it('should provide all specs', function () {
|
||||
var foo;
|
||||
env.beforeEach(function () {
|
||||
foo = 0;
|
||||
});
|
||||
|
||||
env.describe('suite 1', function () {
|
||||
env.it('test 1-1', function() {
|
||||
foo++;
|
||||
this.expect(foo).toEqual(1);
|
||||
});
|
||||
env.it('test 1-2', function() {
|
||||
foo++;
|
||||
this.expect(foo).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
env.describe('suite 2', function () {
|
||||
env.it('test 2-1', function() {
|
||||
foo++;
|
||||
this.expect(foo).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
env.currentRunner().execute();
|
||||
|
||||
|
||||
expect(env.currentRunner().specs().length).toEqual(3);
|
||||
});
|
||||
});
|
||||
|
||||
describe('afterEach', function() {
|
||||
describe('afterEach', function() {
|
||||
it('should run after each spec for all suites', function () {
|
||||
var foo = 3;
|
||||
env.afterEach(function () {
|
||||
@@ -64,7 +95,7 @@ describe('RunnerTest', function() {
|
||||
|
||||
env.describe('suite 2', function () {
|
||||
env.it('test 2-1', function() {
|
||||
this.expect(foo).toEqual(1);
|
||||
this.expect(foo).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user