Last active
August 28, 2019 13:45
-
-
Save prashanth-sams/5ce246412e9b372d3c4c46d0df018891 to your computer and use it in GitHub Desktop.
Jest Sample Test Suite
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 ('search component', () => { | |
it (`async test 1`, done=>{ | |
setTimeout(done, 100); | |
}); | |
it (`async test 2`, ()=>{ | |
return new Promise( | |
resolve => setTimeout(resolve, 1500) | |
); | |
}); | |
}); |
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 ('search component', () => { | |
beforeAll (() => { | |
console.log('Before all!'); | |
}); | |
beforeEach (() => { | |
console.log('Before each!'); | |
}); | |
it.only (`should display the list of search results`, () => { | |
expect(2 + 2 ).toEqual(4); | |
}); | |
it (`should display the list of search results 2`, () => { | |
expect(2 + 3 ).toEqual(5); | |
}); | |
it.skip (`should display the list of search results 3`, () => { | |
expect(2 + 3 ).toEqual(5); | |
}); | |
afterAll (() => { | |
console.log('After all!'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment