mirror of https://github.com/lukechilds/node.git
Browse Source
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>v6
1 changed files with 4 additions and 4 deletions
@ -1,9 +1,9 @@ |
|||||
'use strict'; |
'use strict'; |
||||
|
|
||||
require('../common'); |
const common = require('../common'); |
||||
const assert = require('assert'); |
const assert = require('assert'); |
||||
|
|
||||
// Should be an invalid package path.
|
// Should be an invalid package path.
|
||||
assert.throws(() => require('package.json'), (err) => { |
assert.throws(() => require('package.json'), |
||||
return err && err.code === 'MODULE_NOT_FOUND'; |
common.expectsError('MODULE_NOT_FOUND') |
||||
}); |
); |
||||
|
Loading…
Reference in new issue