Created
January 1, 2016 22:19
-
-
Save papandreou/ba5b3a41c8456fed9ce7 to your computer and use it in GitHub Desktop.
Attach after and afterEach inside it block
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
it('should foo', function () { | |
console.log("it foo"); | |
after(function () { | |
console.log("after foo"); | |
}); | |
afterEach(function () { | |
console.log("afterEach foo"); | |
}); | |
}); | |
it('should quux', function () { | |
console.log("it bar"); | |
after(function () { | |
console.log("after quux"); | |
}); | |
afterEach(function () { | |
console.log("afterEach quux"); | |
}); | |
}); | |
it('should baz', function () { | |
console.log("it quux"); | |
after(function () { | |
console.log("after baz"); | |
throw new Error('fail after baz'); | |
}); | |
afterEach(function () { | |
console.log("afterEach baz"); | |
}); | |
}); |
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
it foo | |
✓ should foo | |
afterEach foo | |
it bar | |
✓ should quux | |
afterEach foo | |
afterEach quux | |
it quux | |
✓ should baz | |
afterEach foo | |
afterEach quux | |
afterEach baz | |
after foo | |
after quux | |
after baz | |
1) "after all" hook for "should baz" | |
3 passing (5ms) | |
1 failing | |
1) "after all" hook for "should baz": | |
Error: fail after baz | |
at Context.<anonymous> (foo.js:27:15) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment