/** * Demonstrate execution order of code in Jest/Jasmine */ console.log('Before describes'); describe('First test', () => { console.log('Inside first test describe'); beforeAll(() => console.log('Before all')); afterAll(() => console.log('After all')); beforeEach(() => console.log('Before each')); afterEach(() => console.log('After each')); describe('Inner', () => { beforeAll(() => console.log('Before all inner')); afterAll(() => console.log('After all inner')); beforeEach(() => console.log('Before each inner')); afterEach(() => console.log('After each inner')); it('runs a test', () => console.log('>>> Running first test')); it('runs another test', () => console.log('>>> Running second test')); }); it('runs this test too', () => console.log('>>> Running third test')); }); console.log('Between describes'); describe('Second test', () => { console.log('Inside second test describe'); it.skip('doesn\'t run this test', () => console.log('Nope')); }); console.log('After describes');