Created
June 18, 2013 19:58
-
-
Save kevinrobinson/5808736 to your computer and use it in GitHub Desktop.
Jasmine beforeEach functions get called for each nested example
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
describe "setup", => | |
@val = 0 | |
beforeEach => @val += 10 | |
afterEach => @val -= 100 | |
describe "when loaded", => | |
it "a", => expect(this.val).toEqual 10 | |
it "b", => expect(this.val).toEqual 10 | |
it "c", => expect(this.val).toEqual 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check it in tryjasmine.com and notice that there are failure. The beforeEach block is running more times than you might expect.