Skip to content

Instantly share code, notes, and snippets.

@hanipcode
Created November 13, 2017 05:36
Show Gist options
  • Select an option

  • Save hanipcode/2d53c7e61b2dec22eb3df69c2f071f34 to your computer and use it in GitHub Desktop.

Select an option

Save hanipcode/2d53c7e61b2dec22eb3df69c2f071f34 to your computer and use it in GitHub Desktop.
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