Created
November 13, 2017 05:36
-
-
Save hanipcode/2d53c7e61b2dec22eb3df69c2f071f34 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
| import MyService from './api'; | |
| const service = new MyService(); | |
| describe('MY API Service', () => { | |
| let data; | |
| beforeEach(async () => { | |
| const currentUser = { | |
| firstName: 'My', | |
| lastName: 'Name', | |
| gender: 'male', | |
| dateOfBirth: null, | |
| //... rest of data | |
| }; | |
| data = await service.login( | |
| currentUser.firstName, | |
| currentUser.lastName, | |
| currentUser.dateOfBirth, | |
| //...rest of data | |
| ); | |
| }); | |
| it('have a correct login functionality', async () => { | |
| const blob = await data.json(); | |
| expect(data.status).toEqual(200); | |
| expect(blob.message).toEqual('success'); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment