Last active
May 5, 2022 16:05
-
-
Save craigpalermo/3c36ef72a41f4fdbad3e869ed3900ebf to your computer and use it in GitHub Desktop.
This file contains 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 { getName } from '../models/user'; | |
jest.mock('../models/user', {} => ({ | |
getName: jest.fn() | |
})); | |
test('if user model is mocked', () => { | |
getName.mockReturnValue('bob') | |
expect(getName()).toEqual('bob'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment