Browse Source

test: add test-require-invalid-package

Add test for requiriing an invalid package path.

PR-URL: https://github.com/nodejs/node/pull/9903
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
v4.x
Duy Le 8 years ago
committed by Myles Borins
parent
commit
34861efff6
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 9
      test/parallel/test-require-invalid-package.js

9
test/parallel/test-require-invalid-package.js

@ -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';
});
Loading…
Cancel
Save