Skip to content

Commit

Permalink
test: add test-require-invalid-package
Browse files Browse the repository at this point in the history
Add test for requiriing an invalid package path.

PR-URL: nodejs#9903
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
  • Loading branch information
Duy Le authored and Trott committed Dec 21, 2016
1 parent 576cf4b commit 283321e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/parallel/test-require-invalid-package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

require('../common');
const assert = require('assert');

// Should be an invalid package path.
assert.throws(() => require('package.json'), (err) => {
return err && err.code === 'MODULE_NOT_FOUND';
});

0 comments on commit 283321e

Please sign in to comment.