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 <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 MylesBorins committed Jan 24, 2017
1 parent 1b52c2b commit 4148c43
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 4148c43

Please sign in to comment.