test: Add test case for MODULE_NOT_FOUND.
This commit is contained in:
parent
ec11525d33
commit
855f46677c
@ -31,3 +31,12 @@ assert.throws(function() {
|
|||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
require(common.fixturesDir + '/throws_error');
|
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…
x
Reference in New Issue
Block a user