Created
April 20, 2023 15:21
-
-
Save felipekm/33a078bce72389316d67a4a08cb73afb to your computer and use it in GitHub Desktop.
Jest Mock Class
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
const mock = jest.mock('@services/plaid', () => { | |
const PlaidService = jest.requireActual('@services/plaid'); | |
return class PlaidServiceMock extends PlaidService { | |
constructor() { | |
super(); | |
this.somefn = jest.fn(() => { | |
return { token: 'test' }; | |
}); | |
} | |
}; | |
}); | |
module.exports = { mock }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment