Last active
March 29, 2018 21:49
-
-
Save theKashey/4d1b73a4256cf4a4bc158cef40dcf570 to your computer and use it in GitHub Desktop.
Rewiremock proxyquire
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 sinon from 'sinon'; | |
const Launch = sinon.stub() | |
// const case = proxyquire.load('./dooms-day.js',{ | |
const case = rewiremock.proxy('./dooms-day.js',{ | |
'./rocket-silo': { Launch }, | |
'doom-scheduler': { theDay: Promise.resolve()} | |
}); | |
expect(Launch).toHaveBeenCalled(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment