Skip to content

Commit 6502427

Browse files
Oscar MartinezFishrock123
Oscar Martinez
authored andcommitted
test: refactor test-require-exceptions
Updated regex for error assertion. PR-URL: #9882 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a801ffb commit 6502427

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-require-exceptions.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

55
// A module with an error in it should throw
66
assert.throws(function() {
77
require(common.fixturesDir + '/throws_error');
8-
});
8+
}, /^Error: blah$/);
99

1010
// Requiring the same module again should throw as well
1111
assert.throws(function() {
1212
require(common.fixturesDir + '/throws_error');
13-
});
13+
}, /^Error: blah$/);
1414

1515
// Requiring a module that does not exist should throw an
1616
// error with its `code` set to MODULE_NOT_FOUND

0 commit comments

Comments
 (0)