Created
June 12, 2018 20:11
-
-
Save gpittarelli/123fcf7864a41b4117850469a6153dbb to your computer and use it in GitHub Desktop.
Mocha hooks ordering
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
describe("Level 1", () => { | |
before(() => console.log("before 1")); | |
beforeEach(() => console.log("beforeEach 1")); | |
before(() => console.log("before 2")); | |
beforeEach(() => console.log("beforeEach 2")); | |
after(() => console.log("after 1")); | |
afterEach(() => console.log("afterEach 1")); | |
after(() => console.log("after 2")); | |
afterEach(() => console.log("afterEach 2")); | |
describe("Level 2", () => { | |
before(() => console.log("before 3")); | |
beforeEach(() => console.log("beforeEach 3")); | |
before(() => console.log("before 4")); | |
beforeEach(() => console.log("beforeEach 4")); | |
after(() => console.log("after 3")); | |
afterEach(() => console.log("afterEach 3")); | |
after(() => console.log("after 4")); | |
afterEach(() => console.log("afterEach 4")); | |
it("Test", () => {}); | |
}); | |
}); | |
Level 1 | |
before 1 | |
before 2 | |
Level 2 | |
before 3 | |
before 4 | |
beforeEach 1 | |
beforeEach 2 | |
beforeEach 3 | |
beforeEach 4 | |
✓ Test | |
afterEach 3 | |
afterEach 4 | |
afterEach 1 | |
afterEach 2 | |
after 3 | |
after 4 | |
after 1 | |
after 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment