Last active
December 28, 2023 08:21
-
-
Save night-fury-rider/67de93d5e2e4c238f8d315bc8162be50 to your computer and use it in GitHub Desktop.
Jest - Partially Mocking Own Methods
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
jest.mock("$dashboard/ContactService", ()=> { | |
const actualModule = jest.requireActual("../dashboard/ContactService"); | |
return { | |
__esModule: true, | |
...actualModule, | |
size: 100, | |
deleteContact: jest.fn() | |
} | |
open: jest.fn() | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment