Skip to content

Instantly share code, notes, and snippets.

@whtswrng
Created December 9, 2018 11:55
Show Gist options
  • Save whtswrng/0fe3e0a21e99df8f4e7d6f560ca9419a to your computer and use it in GitHub Desktop.
Save whtswrng/0fe3e0a21e99df8f4e7d6f560ca9419a to your computer and use it in GitHub Desktop.
describe('when try to log out user', () => {
describe('and when is user logged in', () => {
beforeEach(async () => {
// ...
isUserLoggedIn = jest.fn().mockImplementation(() => new Promise((resolve) => resolve(true)));
logOutAction = jest.fn();
// ...
});
it('should log user out', () => {
expect(logOutAction).toHaveBeenCalledTimes(1);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment