Last active
August 29, 2015 14:01
-
-
Save miguelsaddress/ee744ece9fe58211c81e to your computer and use it in GitHub Desktop.
Angular test execution order.
This file contains hidden or 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
beforeEach( function(){ console.log("Global before each")} ); | |
describe( "Describe 1", function(){ | |
beforeEach( function(){ console.log("Describe 1 - before each 1")} ); | |
beforeEach( function(){ console.log("Describe 1 - before each 2")} ); | |
//do tests... | |
it("a test...", function(){ | |
//if there is not a "it()", the beforeEach/afterEach does not execute | |
}); | |
afterEach( function(){ console.log("Describe 1 - after each 1")} ); | |
afterEach( function(){ console.log("Describe 1 - after each 2")} ); | |
}); | |
describe( "Describe 2", function(){ | |
beforeEach( function(){ console.log("Describe 2 - before each 1")} ); | |
beforeEach( function(){ console.log("Describe 2 - before each 2")} ); | |
//do tests... | |
it("a test...", function(){ | |
//if there is not a "it()", the beforeEach/afterEach does not execute | |
}); | |
afterEach( function(){ console.log("Describe 2 - after each 1")} ); | |
afterEach( function(){ console.log("Describe 2 - after each 2")} ); | |
}); | |
afterEach( function(){ console.log("Global after each 1")} ); | |
afterEach( function(){ console.log("Global after each 2")} ); |
This file contains hidden or 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
LOG: 'Global before each' | |
LOG: 'Describe 1 - before each 1' | |
LOG: 'Describe 1 - before each 2' | |
LOG: 'Describe 1 - after each 2' | |
LOG: 'Describe 1 - after each 1' | |
LOG: 'Global after each 2' | |
LOG: 'Global after each 1' | |
LOG: 'Global before each' | |
LOG: 'Describe 2 - before each 1' | |
LOG: 'Describe 2 - before each 2' | |
LOG: 'Describe 2 - after each 2' | |
LOG: 'Describe 2 - after each 1' | |
LOG: 'Global after each 2' | |
LOG: 'Global after each 1' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment