Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Last active August 28, 2019 13:45
Show Gist options
  • Save prashanth-sams/5ce246412e9b372d3c4c46d0df018891 to your computer and use it in GitHub Desktop.
Save prashanth-sams/5ce246412e9b372d3c4c46d0df018891 to your computer and use it in GitHub Desktop.
Jest Sample Test Suite
describe ('search component', () => {
it (`async test 1`, done=>{
setTimeout(done, 100);
});
it (`async test 2`, ()=>{
return new Promise(
resolve => setTimeout(resolve, 1500)
);
});
});
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