Browse Source

test: Add test case for MODULE_NOT_FOUND.

v0.7.4-release
Nathan Rajlich 13 years ago
committed by koichik
parent
commit
855f46677c
  1. 9
      test/simple/test-require-exceptions.js

9
test/simple/test-require-exceptions.js

@ -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…
Cancel
Save