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: #9903
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
  • Loading branch information
Duy Le authored and MylesBorins committed Jan 24, 2017
1 parent 3e5dd7a commit 0f05173
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 0f05173

Please sign in to comment.