Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 141cd23

Browse files
Trottsagitsofan
authored andcommittedOct 12, 2018
test: remove internal errorCache property
The internal `assert` modules `errorCache` property is exposed only for testing. The one test that used it is rewritten here to not use it. This has the following advantages: * The test now makes sure that there is an empty cache in a more robust way. Instead of relying on the internal implementation of `errorCache`, it simply spawns a separate process. * One less test using the `--expose-internals` flag. PR-URL: nodejs#23304 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 7a3b34a commit 141cd23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎test/parallel/test-assert-builtins-not-read-from-filesystem.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ if (process.argv[2] !== 'child') {
1919
e.emit('hello', false);
2020
} catch (err) {
2121
const frames = err.stack.split('\n');
22-
const [, filename, line, column] = frames[1].match(/\((.+):(\d+):(\d+)\)/);
22+
const [, filename, , ] = frames[1].match(/\((.+):(\d+):(\d+)\)/);
2323
// Spawn a child process to avoid the error having been cached in the assert
2424
// module's `errorCache` Map.
2525

2626
const { output, status, error } =
2727
spawnSync(process.execPath,
28-
[process.argv[1], 'child', filename, line, column],
28+
[process.argv[1], 'child', filename],
2929
{ cwd: tmpdir.path, env: process.env });
3030
assert.ifError(error);
3131
assert.strictEqual(status, 0, `Exit code: ${status}\n${output}`);

0 commit comments

Comments
 (0)
Please sign in to comment.