Browse Source

test: use expectsError in require-invalid-package

Use common.expectsError() in place of inline validation function in
test-require-invalid-package.

PR-URL: https://github.com/nodejs/node/pull/11409
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v7.x
Rich Trott 8 years ago
committed by Italo A. Casas
parent
commit
ae9b891a39
No known key found for this signature in database GPG Key ID: 23EFEFE93C4CFFFE
  1. 8
      test/parallel/test-require-invalid-package.js

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

@ -1,9 +1,9 @@
'use strict';
require('../common');
const common = 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';
});
assert.throws(() => require('package.json'),
common.expectsError('MODULE_NOT_FOUND')
);

Loading…
Cancel
Save