Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
test: Add test case for MODULE_NOT_FOUND.
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate authored and koichik committed Dec 19, 2011
1 parent ec11525 commit 855f466
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/simple/test-require-exceptions.js
Expand Up @@ -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;
});

0 comments on commit 855f466

Please sign in to comment.