Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ tools/test.py child-process
```

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

```bash
tools/test.py test/message
```text
$ tools/test.py test/report
```

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

> Note: On Windows you should use `python3` executable.
> Example: `python3 tools/test.py test/message`
> Example: `python3 tools/test.py test/report`

You can usually run tests directly with node:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

require('../common');
require('../../common');
const assert = require('assert').strict;

assert.throws(() => { throw new Error('foo'); }, { bar: true });
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node:assert:*
node:assert*
throw err;
^

Expand All @@ -9,7 +9,7 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
- Comparison {
- bar: true
- }
at Object.<anonymous> (*assert_throws_stack.js:*:*)
at *
at *
at *
at *
Expand All @@ -19,16 +19,16 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: Error: foo
at assert.throws.bar (*assert_throws_stack.js:*)
at getActual (node:assert:*)
at Function.throws (node:assert:*)
at Object.<anonymous> (*assert_throws_stack.js:*:*)
at *
at *
at *
at *
at *
at *,
at *
at *
at *
at *
at node:internal*main*run_main_module**,
expected: { bar: true },
operator: 'throws'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

// Flags: --expose-internals
require('../common');
require('../../common');

const assert = require('internal/assert');
assert(false);
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
node:internal/assert:*
node:internal*assert*
throw new ERR_INTERNAL_ASSERTION(message);
^

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

at new NodeError (node:internal/errors:*:*)
at assert (node:internal/assert:*:*)
at * (*test*message*internal_assert.js:7:1)
at *
at *
at *
at *
at *
at *
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

// Flags: --expose-internals
require('../common');
require('../../common');

const assert = require('internal/assert');
assert.fail('Unreachable!');
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
node:internal/assert:*
node:internal*assert*
throw new ERR_INTERNAL_ASSERTION(message);
^

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

at new NodeError (node:internal/errors:*:*)
at Function.fail (node:internal/assert:*:*)
at * (*test*message*internal_assert_fail.js:7:8)
at *
at *
at *
at *
at *
at *
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
require('../common');
require('../../common');
Error.stackTraceLimit = 3;

const punycode = require('punycode');
Expand Down
10 changes: 10 additions & 0 deletions test/fixtures/console/core_line_numbers.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node:punycode:*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@projectnoa there are still many files that do not appear as moved

throw new RangeError(errors[type]);
^

RangeError: Invalid input
at *
at *
at *

Node.js *
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

'use strict';

require('../common');
require('../../common');

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

Expand Down
81 changes: 81 additions & 0 deletions test/fixtures/console/eval_messages.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[eval]
at *
with(this){__filename}
^^^^

SyntaxError: Strict mode code may not include a with statement
at *
at *
at *
at *
at *
at *
at *
at *

Node.js *
*
*
at *
throw new Error("hello")
^

Error: hello
at *
at *
at *
at *
at *
at *
at *
at *

Node.js *
at *
throw new Error("hello")
^

Error: hello
at *
at *
at *
at *
at *
at *
at *
at *

Node.js *
*
at *
var x = *; y = x;
^

ReferenceError: y is not defined
at *
at *
at *
at *
at *
at *
at *
at *

Node.js *

at *
var ______________________________________________; throw *
^
*
(Use `node --trace-uncaught ...` to show where the exception was thrown)

Node.js *

at *
var ______________________________________________; throw *
^
*
(Use `node --trace-uncaught ...` to show where the exception was thrown)

Node.js *
done
2 changes: 1 addition & 1 deletion test/fixtures/console/force_colors.snapshot
Original file line number Diff line number Diff line change
@@ -1 +1 @@
123 foo { bar: 'baz' }
123 foo { bar: 'baz' }
2 changes: 1 addition & 1 deletion test/fixtures/console/stack_overflow.snapshot
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
before
*test*fixtures*console*stack_overflow.js:*
at *
JSON.stringify(array);
^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

'use strict';

require('../common');
require('../../common');

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

Expand Down
89 changes: 89 additions & 0 deletions test/fixtures/console/stdin_messages.snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[stdin]
at *
with(this){__filename}
^^^^

SyntaxError: Strict mode code may not include a with statement
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *

Node.js *
*
*
at *
throw new Error("hello")
^

Error: hello
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *

Node.js *
at *
throw new Error("hello")
^

Error: hello
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *

Node.js *
*
at *
let x = *; y = x;
^

ReferenceError: y is not defined
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *

Node.js *

at *
let ______________________________________________; throw *
^
*
(Use `node --trace-uncaught ...` to show where the exception was thrown)

Node.js *

at *
let ______________________________________________; throw *
^
*
(Use `node --trace-uncaught ...` to show where the exception was thrown)

Node.js *
done
14 changes: 7 additions & 7 deletions test/fixtures/errors/force_colors.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ throw new Error('Should include grayed stack trace')
^

Error: Should include grayed stack trace
at Object.<anonymous> (/test*force_colors.js:1:7)
 at Module._compile (node:internal*modules*cjs*loader:1255:14)
 at Module._extensions..js (node:internal*modules*cjs*loader:1309:10)
 at Module.load (node:internal*modules*cjs*loader:1113:32)
 at Module._load (node:internal*modules*cjs*loader:960:12)
 at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:83:12)
 at node:internal*main*run_main_module:23:47
at Object.<anonymous> (*force_colors.js:1:7)
at Module._compile (node:internal*modules*cjs*loader:1255:14)
at Module._extensions..js (node:internal*modules*cjs*loader:1309:10)
at Module.load (node:internal*modules*cjs*loader:1113:32)
at Module._load (node:internal*modules*cjs*loader:960:12)
at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:83:12)
at node:internal*main*run_main_module:23:47

Node.js *
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

require('../common');
require('../../common');
Error.stackTraceLimit = 4;

const assert = require('assert');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node:assert:*
^

AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error
at z (*if-error-has-good-stack.js:*:*
at z (*if-error-has-good-stack.js:*:*)
at y (*if-error-has-good-stack.js:*:*)
at x (*if-error-has-good-stack.js:*:*)
at Object.<anonymous> (*if-error-has-good-stack.js:*:*)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Flags: --no-extra-info-on-fatal-exception

'use strict';
require('../common');
require('../../common');
Error.stackTraceLimit = 1;

throw new Error('foo');
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*test-no-extra-info-on-fatal-exception.js:*
throw new Error('foo');
^

Error: foo
at *
Loading