Last active
August 29, 2015 14:18
-
-
Save NickHeiner/5009b311f725227fc433 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Make a bunch of stub objects like this, | |
// commingling mock behavior with test assertions. | |
const npm = { | |
config: { | |
get: function(prop) { | |
expect(prop).to.equal('registry'); | |
if (prop === 'registry') { | |
return npmRegistry; | |
} | |
} | |
} | |
}, | |
_ = require('lodash'), | |
q = require('q'), | |
packageExists = proxyquire('../../../lib/core/package-exists', { | |
// Mock out everything this module needs. Here's one example: | |
'../utils/get-npm': _.constant(q(npm)) | |
// So much cruft, even for something so simple! | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment