Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: migrated test/message to JS fixture tests #47868

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions test/fixtures/console/core_line_numbers.snapshot
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
node:punycode:*
node:punycode:49
throw new RangeError(errors[type]);
^

RangeError: Invalid input
MoLow marked this conversation as resolved.
Show resolved Hide resolved
at *
at *
at *
at error (node:punycode:49:8)
at Object.decode (node:punycode:*:*)
at Object.<anonymous> (*test*message*core_line_numbers.js:*:*)

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

SyntaxError: Strict mode code may not include a with statement
at *
at *
at *
at *
at *
at *
at *
at *
at new Script (node:vm:*:*)
at createScript (node:vm:*:*)
at Object.runInThisContext (node:vm:*:*)
at node:internal/process/execution:*:*
at [eval]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_string:*:*
Comment on lines +6 to +13
Copy link
Member

Choose a reason for hiding this comment

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

This stack trace is a step backward; this test will break if this call path ever changes, which isn’t something that should be breaking a test. Can we eliminate this from the snapshot, perhaps by updating the snapshot generation script if necessary?


Node.js *
*
*
at *
42
42
[eval]:1
throw new Error("hello")
^

Error: hello
at *
at *
at *
at *
at *
at *
at *
at *
at [eval]:1:7
at Script.runInThisContext (node:vm:*:*)
at Object.runInThisContext (node:vm:*:*)
at node:internal/process/execution:*:*
at [eval]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_string:*:*

Node.js *
at *

[eval]:1
throw new Error("hello")
^

Error: hello
at *
at *
at *
at *
at *
at *
at *
at *
at [eval]:1:7
at Script.runInThisContext (node:vm:*:*)
at Object.runInThisContext (node:vm:*:*)
at node:internal/process/execution:*:*
at [eval]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_string:*:*

Node.js *
*
at *
var x = *; y = x;
100
[eval]:1
var x = 100; y = x;
^

ReferenceError: y is not defined
at *
at *
at *
at *
at *
at *
at *
at *
at [eval]:1:16
at Script.runInThisContext (node:vm:*:*)
at Object.runInThisContext (node:vm:*:*)
at node:internal/process/execution:*:*
at [eval]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_string:*:*

Node.js *

at *
var ______________________________________________; throw *
[eval]:1
var ______________________________________________; throw 10
^
*
(Use `node --trace-uncaught ...` to show where the exception was thrown)
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)

Node.js *

at *
var ______________________________________________; throw *
[eval]:1
var ______________________________________________; throw 10
^
*
(Use `node --trace-uncaught ...` to show where the exception was thrown)
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)

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

SyntaxError: Strict mode code may not include a with statement
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *
at new Script (node:vm:*)
at createScript (node:vm:*)
at Object.runInThisContext (node:vm:*)
at node:internal/process/execution:*:*
at [stdin]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_stdin:*:*
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)

Node.js *
*
*
at *
42
42
[stdin]:1
throw new Error("hello")
^

Error: hello
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *
at [stdin]:1:7
at Script.runInThisContext (node:vm:*)
at Object.runInThisContext (node:vm:*)
at node:internal/process/execution:*:*
at [stdin]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_stdin:*:*
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)

Node.js *
at *
[stdin]:1
throw new Error("hello")
^

Error: hello
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *
at [stdin]:1:*
at Script.runInThisContext (node:vm:*)
at Object.runInThisContext (node:vm:*)
at node:internal/process/execution:*:*
at [stdin]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_stdin:*:*
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)

Node.js *
*
at *
let x = *; y = x;
100
[stdin]:1
let x = 100; y = x;
^

ReferenceError: y is not defined
at *
at *
at *
at *
at *
at *
at *
at *
at *
at *
at [stdin]:1:16
at Script.runInThisContext (node:vm:*)
at Object.runInThisContext (node:vm:*)
at node:internal/process/execution:*:*
at [stdin]-wrapper:*:*
at runScript (node:internal/process/execution:*:*)
at evalScript (node:internal/process/execution:*:*)
at node:internal/main/eval_stdin:*:*
at Socket.<anonymous> (node:internal/process/execution:*:*)
at Socket.emit (node:events:*:*)

Node.js *

at *
let ______________________________________________; throw *
[stdin]:1
let ______________________________________________; throw 10
^
*
(Use `node --trace-uncaught ...` to show where the exception was thrown)
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)

Node.js *

at *
let ______________________________________________; throw *
[stdin]:1
let ______________________________________________; throw 10
^
*
(Use `node --trace-uncaught ...` to show where the exception was thrown)
10
(Use `* --trace-uncaught ...` to show where the exception was thrown)

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

Error: foo
at *
at Object.<anonymous> (*:7:7)
10 changes: 5 additions & 5 deletions test/fixtures/errors/throw_error_with_getter_throw.snapshot
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

at *
throw { * eslint-disable-line no-throw-literal
*test*message*throw_null.js:*
throw null;
^
[object Object]
(Use `node --trace-uncaught ...` to show where the exception was thrown)
null
(Use `* --trace-uncaught ...` to show where the exception was thrown)

Node.js *
Node.js *
Copy link
Member

Choose a reason for hiding this comment

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

Why are all these files not ending with newlines? Aren’t they autogenerated?

4 changes: 2 additions & 2 deletions test/fixtures/errors/throw_null.snapshot
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

at *
*test*message*throw_null.js:*
throw null;
^
null
(Use `node --trace-uncaught ...` to show where the exception was thrown)
(Use `* --trace-uncaught ...` to show where the exception was thrown)

Node.js *
4 changes: 2 additions & 2 deletions test/fixtures/errors/throw_undefined.snapshot
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

at *
*test*message*throw_undefined.js:*
throw undefined;
^
undefined
(Use `node --trace-uncaught ...` to show where the exception was thrown)
(Use `* --trace-uncaught ...` to show where the exception was thrown)

Node.js *
9 changes: 4 additions & 5 deletions test/fixtures/errors/timeout_throw.snapshot
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
*timeout_throw.js:*
*test*message*timeout_throw.js:*
undefined_reference_error_maker;
^

ReferenceError: undefined_reference_error_maker is not defined
at *
at *
at *
at Timeout._onTimeout (*test*message*timeout_throw.js:*:*)
at listOnTimeout (node:internal/timers:*:*)
at process.processTimers (node:internal/timers:*:*)

Node.js *
12 changes: 6 additions & 6 deletions test/fixtures/errors/undefined_reference_in_new_context.snapshot
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
before
at *
evalmachine.<anonymous>:1
Error.stackTraceLimit = 5; foo.bar = 5;
^

ReferenceError: foo is not defined
at *
at *
at *
at *
at *
at evalmachine.<anonymous>:*:*
at Script.runInContext (node:vm:*)
at Script.runInNewContext (node:vm:*)
at Object.runInNewContext (node:vm:*)
at Object.<anonymous> (*test*message*undefined_reference_in_new_context.js:*)

Node.js *
Loading