Mock process.cwd to make test pass in headless mode

This commit is contained in:
Nathan Sobo 2015-10-16 12:21:32 -06:00
parent badba2810e
commit eb2a6a3388

View File

@ -86,6 +86,7 @@ describe 'ModuleCache', ->
exports.load = function() { require('underscore-plus'); };
"""
spyOn(process, 'cwd').andReturn('/') # Required when running this test from CLI
packageMain = require(indexPath)
Module._findPath.reset()
expect(-> packageMain.load()).toThrow()