Skip to content

Instantly share code, notes, and snippets.

@theKashey
Last active March 29, 2018 12:19
Show Gist options
  • Save theKashey/d24a452ea2850814f7e65dfa23e689a9 to your computer and use it in GitHub Desktop.
Save theKashey/d24a452ea2850814f7e65dfa23e689a9 to your computer and use it in GitHub Desktop.
Rewiremock jest
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