Last active
March 29, 2018 12:19
-
-
Save theKashey/d24a452ea2850814f7e65dfa23e689a9 to your computer and use it in GitHub Desktop.
Rewiremock jest
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 rewiremock from 'rewiremock'; | |
import {Launch} from './rocket-silo'; | |
import {theDay} from 'doom-scheduler' | |
import 'rocket-silo'; | |
// prev jest.mock('doom-scheduler'); | |
rewiremock('./rocket-silo').mockThrough(); | |
rewiremock('doom-scheduler').mockThrough(); | |
theDay.resolves("comming!"); // sinon | |
expect(Launch).toHaveBeenCalled(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment