Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
fix(test): Verified order of callbacks
Browse files Browse the repository at this point in the history
Added a unit test to make sure we don't run afterEach from other suites

closes #90
  • Loading branch information
bahmutov committed Feb 22, 2016
1 parent da5a1e1 commit eb575f3
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions test/issue-90-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* global describe, ngDescribe, it, beforeEach, afterEach */
describe('issue 90 - plain BDD', function () {
describe('1', function () {
it('works', function () {
console.log('1.1');
});
it('works', function () {
console.log('1.2');
});
});

describe('2', function () {
afterEach(function () {
console.log('After');
});
beforeEach(function () {
console.log('Before');
});
it('works', function () {
console.log('2.1');
});
it('works', function () {
console.log('2.2');
});
});

describe('3', function () {
it('works', function () {
console.log('3.1');
});
it('works', function () {
console.log('3.2');
});
});
});

describe('issue 90 - inside ngDescribe', function () {
ngDescribe({
name: 'issue 90',
tests: function () {
describe('1', function () {
it('works', function () {
console.log('1.1');
});
it('works', function () {
console.log('1.2');
});
});

describe('2', function () {
afterEach(function () {
console.log('After');
});
beforeEach(function () {
console.log('Before');
});
it('works', function () {
console.log('2.1');
});
it('works', function () {
console.log('2.2');
});
});

describe('3', function () {
it('works', function () {
console.log('3.1');
});
it('works', function () {
console.log('3.2');
});
});
}
});
});

0 comments on commit eb575f3

Please sign in to comment.