Skip to content

Commit

Permalink
test: use expectsError in require-invalid-package
Browse files Browse the repository at this point in the history
Use common.expectsError() in place of inline validation function in
test-require-invalid-package.

PR-URL: #11409
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Trott authored and italoacasas committed Feb 25, 2017
1 parent 91fac08 commit ae9b891
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-require-invalid-package.js
Original file line number Diff line number Diff line change
@@ -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')
);

0 comments on commit ae9b891

Please sign in to comment.