mirror of https://github.com/nodejs/node.git
test: Add test case for MODULE_NOT_FOUND.
parent
ec11525d33
commit
855f46677c
|
@ -31,3 +31,12 @@ assert.throws(function() {
|
|||
assert.throws(function() {
|
||||
require(common.fixturesDir + '/throws_error');
|
||||
});
|
||||
|
||||
// Requiring a module that does not exist should throw an
|
||||
// error with its `code` set to MODULE_NOT_FOUND
|
||||
assert.throws(function () {
|
||||
require(common.fixturesDir + '/DOES_NOT_EXIST');
|
||||
}, function (e) {
|
||||
assert.equal('MODULE_NOT_FOUND', e.code);
|
||||
return true;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue