forked from joeljeske/karma-parallel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Call through for global before-* and after-* blocks (fixes joeljeske#64)
- Loading branch information
1 parent
4234197
commit c62b259
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
window.GlobalConditions = { | ||
beforeAllCount: 0, | ||
beforeEachCount: 0, | ||
afterEachCount: 0, | ||
afterAllCount: 0, | ||
testRunCount: 0, | ||
beforeAll: function beforeAll() { this.beforeAllCount++; }, | ||
beforeEach: function beforeEach() { this.beforeEachCount++; }, | ||
afterEach: function afterEach() { this.afterEachCount++; }, | ||
afterAll: function afterAll() { this.afterAllCount++; }, | ||
testRun: function testRun() { this.testRunCount++; }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
(before || beforeAll)(() => { | ||
GlobalConditions.beforeAll(); | ||
}); | ||
|
||
beforeEach(() => { | ||
GlobalConditions.beforeEach(); | ||
}); | ||
|
||
afterEach(() => { | ||
GlobalConditions.afterEach(); | ||
}); | ||
|
||
(after || afterAll)(() => { | ||
GlobalConditions.afterAll(); | ||
}); | ||
|
||
|
||
|
||
describe('set global conditions', function() { | ||
describe('first subject', function() { | ||
it('has a test', function() { | ||
expect(GlobalConditions.testRun()); | ||
}); | ||
it('has another test', function() { | ||
expect(GlobalConditions.testRun()); | ||
}); | ||
}); | ||
describe('second subject', function() { | ||
it('has a test', function() { | ||
expect(GlobalConditions.testRun()); | ||
}); | ||
it('has another test', function() { | ||
expect(GlobalConditions.testRun()); | ||
}); | ||
}); | ||
describe('third subject', function() { | ||
it('has a test', function() { | ||
expect(GlobalConditions.testRun()); | ||
}); | ||
it('has another test', function() { | ||
expect(GlobalConditions.testRun()); | ||
}); | ||
}); | ||
}); |