Last active
August 29, 2015 14:24
-
-
Save ikr/996db09f46eae2fed0e5 to your computer and use it in GitHub Desktop.
Nested contexts for tests
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('RedBlackTree', () => { | |
beforeEach(() => { | |
// Set-up code | |
}); | |
it('does this', () => { | |
// Asserts | |
}); | |
it('does that', () => { | |
// Asserts | |
}); | |
describe('when empty', () => { | |
beforeEach(() => { | |
// Set-up code for the "empty" case | |
}); | |
// it-s with asserts | |
}); | |
describe('insertion', () => { | |
// Some set-up with beforeEach | |
describe('happy case', () => { | |
// Additional set-up with beforeEach | |
// Asserts | |
}); | |
describe('when heavily unbalanced', () => { | |
// Additional set-up with beforeEach | |
// Asserts | |
}); | |
}); | |
// ... and so on | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment