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>v7.x
Rich Trott
8 years ago
committed by
Italo A. Casas
1 changed files with 4 additions and 4 deletions
@ -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…
Reference in new issue