Last active
June 16, 2016 20:56
-
-
Save rbartoli/e3099ca5b0704e477a86 to your computer and use it in GitHub Desktop.
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( 'Top level suite', function() { | |
describe( 'Second level test suite', function() { | |
before( function() { | |
// executes once, before all tests | |
} ); | |
beforeEach( function() { | |
// executes before each test of the suite | |
} ); | |
after( function() { | |
// executes once, after all tests | |
} ); | |
afterEach( function() { | |
// executes after each test of the suite | |
} ); | |
it( 'should verify a behavior', function() { | |
// a test containing assertions | |
} ); | |
it('should verify an async behaviour', function() { | |
setTimeout(() => { | |
try { | |
// expect here | |
done() | |
} catch(e) { | |
done(e) | |
} | |
}, 100) | |
}) | |
xit( 'should be a pending test', function() { | |
// this test is pending. All assertions inside are ignored. | |
} ); | |
it.skip( 'should also be a pending test', function() { | |
// it.skip is a longer, more semantic form of xit | |
} ); | |
it( 'should also be a pending test' ); | |
} ); | |
describe( 'Another second level test suite', function() { | |
} ); | |
} ); | |
describe( 'Maintainable unit test cases...', function( ) { | |
it( 'should test one type of behavior' ); | |
it( 'should not depend on any other test cases.' ); | |
it( 'should execute with exact same initial state as any other tests in the suite.' ); | |
it( 'should not matter in which order are these tests executed.' ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment