Created
April 13, 2012 17:43
-
-
Save domenic/2378684 to your computer and use it in GitHub Desktop.
Mocha unexpected async behavior
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("Outer", function () { | |
var promise = null; | |
beforeEach(function () { | |
setTimeout(function () { | |
console.error("Outer beforeEach"); | |
}, 0); | |
}); | |
describe("Inner A", function () { | |
beforeEach(function () { | |
console.error("Inner beforeEach A"); | |
}); | |
it("Inner A", function () { | |
console.error("Inner A"); | |
}); | |
}); | |
describe("Inner B", function () { | |
beforeEach(function () { | |
console.error("Inner beforeEach B"); | |
}); | |
it("Inner B", function () { | |
console.error("Inner B"); | |
}); | |
}); | |
}); |
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
Outer beforeEach | |
Inner beforeEach A | |
Inner A | |
Inner beforeEach B | |
Inner B | |
Outer beforeEach |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment