Skip to content

Commit 398246f

Browse files
committed
tests: fix error message
Fix following review. Reinstated assertion on error message, and corrected comment. Leaving continu to break loop and avoid unneeded assertions. Fixes: #17148 Refs: #17148 (comment)
1 parent 518b133 commit 398246f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/parallel/test-require-deps-deprecation.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ for (const m of deprecatedModules) {
3939
} catch (err) {}
4040
}
4141

42-
// Instead of checking require, check that resolve isn't pointing toward
43-
// /node/deps, as user might already have node installed with acorn in
44-
// require.resolve range
42+
// Instead of checking require, check that resolve isn't pointing toward a
43+
// built-in module, as user might already have node installed with acorn in
44+
// require.resolve range.
45+
// Ref: https://github.com/nodejs/node/issues/17148
4546
for (const m of deps) {
4647
let path;
4748
try {
4849
path = require.resolve(m);
4950
} catch (err) {
51+
assert.ok(err.toString().startsWith('Error: Cannot find module '));
5052
continue;
5153
}
5254
assert.notStrictEqual(path, m);

0 commit comments

Comments
 (0)