Skip to content

Commit

Permalink
tests: fix error message
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Tiriel committed Dec 27, 2017
1 parent 518b133 commit 398246f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/parallel/test-require-deps-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ for (const m of deprecatedModules) {
} catch (err) {}
}

// Instead of checking require, check that resolve isn't pointing toward
// /node/deps, as user might already have node installed with acorn in
// require.resolve range
// Instead of checking require, check that resolve isn't pointing toward a
// built-in module, as user might already have node installed with acorn in
// require.resolve range.
// Ref: https://github.com/nodejs/node/issues/17148
for (const m of deps) {
let path;
try {
path = require.resolve(m);
} catch (err) {
assert.ok(err.toString().startsWith('Error: Cannot find module '));
continue;
}
assert.notStrictEqual(path, m);
Expand Down

0 comments on commit 398246f

Please sign in to comment.