Skip to content

Commit 2df37de

Browse files
committed
test: migrate message tests to js fixtures squashed
test: migrate message tests to js fixtures squashed Add test runners to /parallel dir and fix snapshot Update test/parallel/test-node-output-tick.mjs Co-authored-by: Moshe Atlow <[email protected]> Update test/parallel/test-node-output-promise.mjs Co-authored-by: Moshe Atlow <[email protected]> Update test/parallel/test-node-output-assertion.mjs Co-authored-by: Moshe Atlow <[email protected]> Update test/parallel/test-node-output-map.mjs Co-authored-by: Moshe Atlow <[email protected]> fixed snapshot discrepancy with output-errors.mjs Corrected test runner name prefix Removing snapshots that show as 'new' on git diff Restored deleted files Deleted files restored
1 parent e2caafa commit 2df37de

40 files changed

+262
-60
lines changed

BUILDING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ tools/test.py child-process
333333
```
334334

335335
You can also execute the tests in a test suite directory
336-
(such as `test/message`):
336+
(such as `test/report`):
337337

338-
```bash
339-
tools/test.py test/message
338+
```text
339+
$ tools/test.py test/report
340340
```
341341

342342
If you want to check the other options, please refer to the help by using
@@ -347,7 +347,7 @@ tools/test.py --help
347347
```
348348

349349
> Note: On Windows you should use `python3` executable.
350-
> Example: `python3 tools/test.py test/message`
350+
> Example: `python3 tools/test.py test/report`
351351
352352
You can usually run tests directly with node:
353353

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
require('../common');
3+
require('../../common');
44
const assert = require('assert').strict;
55

66
assert.throws(() => { throw new Error('foo'); }, { bar: true });

test/message/assert_throws_stack.out renamed to test/fixtures/assertion/assert_throws_stack.snapshot

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
99
- Comparison {
1010
- bar: true
1111
- }
12-
at Object.<anonymous> (*assert_throws_stack.js:*:*)
12+
at *
13+
at *
1314
at *
1415
at *
1516
at *
@@ -19,16 +20,16 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
1920
generatedMessage: true,
2021
code: 'ERR_ASSERTION',
2122
actual: Error: foo
22-
at assert.throws.bar (*assert_throws_stack.js:*)
23-
at getActual (node:assert:*)
24-
at Function.throws (node:assert:*)
25-
at Object.<anonymous> (*assert_throws_stack.js:*:*)
2623
at *
2724
at *
2825
at *
2926
at *
3027
at *
31-
at *,
28+
at *
29+
at *
30+
at *
31+
at *
32+
at node:internal*main*run_main_module:*:*,
3233
expected: { bar: true },
3334
operator: 'throws'
3435
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
// Flags: --expose-internals
4-
require('../common');
4+
require('../../common');
55

66
const assert = require('internal/assert');
77
assert(false);

test/message/internal_assert.out renamed to test/fixtures/assertion/internal_assert.snapshot

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
node:internal/assert:*
1+
node:internal*assert:*
22
throw new ERR_INTERNAL_ASSERTION(message);
33
^
44

55
Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
6-
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
6+
Please open an issue with this stack trace at https:*github.com*nodejs*node*issues
77

8-
at new NodeError (node:internal/errors:*:*)
9-
at assert (node:internal/assert:*:*)
10-
at * (*test*message*internal_assert.js:7:1)
8+
at *
9+
at *
10+
at *
1111
at *
1212
at *
1313
at *
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
// Flags: --expose-internals
4-
require('../common');
4+
require('../../common');
55

66
const assert = require('internal/assert');
77
assert.fail('Unreachable!');

test/message/internal_assert_fail.out renamed to test/fixtures/assertion/internal_assert_fail.snapshot

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
node:internal/assert:*
1+
node:internal*assert:*
22
throw new ERR_INTERNAL_ASSERTION(message);
33
^
44

55
Error [ERR_INTERNAL_ASSERTION]: Unreachable!
66
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
7-
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
7+
Please open an issue with this stack trace at https:*github.com*nodejs*node*issues
88

9-
at new NodeError (node:internal/errors:*:*)
10-
at Function.fail (node:internal/assert:*:*)
11-
at * (*test*message*internal_assert_fail.js:7:8)
9+
at *
10+
at *
11+
at *
1212
at *
1313
at *
1414
at *

test/message/core_line_numbers.js renamed to test/fixtures/console/core_line_numbers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
require('../common');
2+
require('../../common');
33
Error.stackTraceLimit = 3;
44

55
const punycode = require('punycode');

test/message/eval_messages.js renamed to test/fixtures/console/eval_messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
'use strict';
2323

24-
require('../common');
24+
require('../../common');
2525

2626
const spawn = require('child_process').spawn;
2727

test/message/stdin_messages.js renamed to test/fixtures/console/stdin_messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
'use strict';
2323

24-
require('../common');
24+
require('../../common');
2525

2626
const spawn = require('child_process').spawn;
2727

0 commit comments

Comments
 (0)