Skip to content

Commit

Permalink
test: fix tests after V8 update
Browse files Browse the repository at this point in the history
Adapt to changes in async stack traces and function name inference

PR-URL: #25852
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
  • Loading branch information
targos committed Mar 14, 2019
1 parent 260d5f8 commit 38ad285
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion test/message/esm_display_syntax_error.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ file:///*/test/message/esm_display_syntax_error.mjs:3
await async () => 0;
^^^^^
SyntaxError: Unexpected reserved word
at translators.set (internal/modules/esm/translators.js:*:*)
at internal/modules/esm/translators.js:*:*
at async link (internal/modules/esm/module_job.js:*:*)
2 changes: 2 additions & 0 deletions test/message/esm_display_syntax_error_import.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ file:///*/test/message/esm_display_syntax_error_import.mjs:6
^^^^^^^^
SyntaxError: The requested module '../fixtures/es-module-loaders/module-named-exports' does not provide an export named 'notfound'
at ModuleJob._instantiate (internal/modules/esm/module_job.js:*:*)
at async ModuleJob.run (internal/modules/esm/module_job.js:*:*)
at async Loader.import (internal/modules/esm/loader.js:*:*)
2 changes: 2 additions & 0 deletions test/message/esm_display_syntax_error_import_module.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ import { foo, notfound } from './module-named-exports';
^^^^^^^^
SyntaxError: The requested module './module-named-exports' does not provide an export named 'notfound'
at ModuleJob._instantiate (internal/modules/esm/module_job.js:*:*)
at async ModuleJob.run (internal/modules/esm/module_job.js:*:*)
at async Loader.import (internal/modules/esm/loader.js:*:*)
2 changes: 1 addition & 1 deletion test/message/esm_display_syntax_error_module.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ file:///*/test/fixtures/es-module-loaders/syntax-error.mjs:2
await async () => 0;
^^^^^
SyntaxError: Unexpected reserved word
at translators.set (internal/modules/esm/translators.js:*:*)
at internal/modules/esm/translators.js:*:*
2 changes: 1 addition & 1 deletion test/message/events_unhandled_error_nexttick.out
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Error
at Function.Module.runMain (internal/modules/cjs/loader.js:*:*)
at internal/main/run_main_module.js:*:*
Emitted 'error' event at:
at process.nextTick (*events_unhandled_error_nexttick.js:*:*)
at *events_unhandled_error_nexttick.js:*:*
at processTicksAndRejections (internal/process/task_queues.js:*:*)
at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:*:*)
at Function.Module.runMain (internal/modules/cjs/loader.js:*:*)
Expand Down
16 changes: 8 additions & 8 deletions test/message/stdin_messages.out
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SyntaxError: Strict mode code may not include a with statement
at Object.<anonymous> ([stdin]-wrapper:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*)
at evalScript (internal/process/execution.js:*:*)
at readStdin (internal/main/eval_stdin.js:*:*)
at Socket.process.stdin.on (internal/process/execution.js:*:*)
at internal/main/eval_stdin.js:*:*
at Socket.<anonymous> (internal/process/execution.js:*:*)
at Socket.emit (events.js:*:*)
at endReadableNT (_stream_readable.js:*:*)
42
Expand All @@ -27,8 +27,8 @@ Error: hello
at Object.<anonymous> ([stdin]-wrapper:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*)
at evalScript (internal/process/execution.js:*:*)
at readStdin (internal/main/eval_stdin.js:*:*)
at Socket.process.stdin.on (internal/process/execution.js:*:*)
at internal/main/eval_stdin.js:*:*
at Socket.<anonymous> (internal/process/execution.js:*:*)
at Socket.emit (events.js:*:*)
at endReadableNT (_stream_readable.js:*:*)
[stdin]:1
Expand All @@ -42,8 +42,8 @@ Error: hello
at Object.<anonymous> ([stdin]-wrapper:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*)
at evalScript (internal/process/execution.js:*:*)
at readStdin (internal/main/eval_stdin.js:*:*)
at Socket.process.stdin.on (internal/process/execution.js:*:*)
at internal/main/eval_stdin.js:*:*
at Socket.<anonymous> (internal/process/execution.js:*:*)
at Socket.emit (events.js:*:*)
at endReadableNT (_stream_readable.js:*:*)
100
Expand All @@ -58,8 +58,8 @@ ReferenceError: y is not defined
at Object.<anonymous> ([stdin]-wrapper:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*)
at evalScript (internal/process/execution.js:*:*)
at readStdin (internal/main/eval_stdin.js:*:*)
at Socket.process.stdin.on (internal/process/execution.js:*:*)
at internal/main/eval_stdin.js:*:*
at Socket.<anonymous> (internal/process/execution.js:*:*)
at Socket.emit (events.js:*:*)
at endReadableNT (_stream_readable.js:*:*)

Expand Down
2 changes: 1 addition & 1 deletion test/message/unhandled_promise_trace_warnings.out
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
at promiseRejectHandler (internal/process/promises.js:*)
at Promise.then *
at Promise.catch *
at Immediate.setImmediate (*test*message*unhandled_promise_trace_warnings.js:*)
at Immediate.<anonymous> (*test*message*unhandled_promise_trace_warnings.js:*)
at *
4 changes: 2 additions & 2 deletions test/parallel/test-performance-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ const {

{
// Intentional non-op. Do not wrap in common.mustCall();
const n = performance.timerify(() => {});
const n = performance.timerify(function noop() {});

const obs = new PerformanceObserver(common.mustCall((list) => {
const entries = list.getEntries();
const entry = entries[0];
assert(entry);
assert.strictEqual(entry.name, 'performance.timerify');
assert.strictEqual(entry.name, 'noop');
assert.strictEqual(entry.entryType, 'function');
assert.strictEqual(typeof entry.duration, 'number');
assert.strictEqual(typeof entry.startTime, 'number');
Expand Down
3 changes: 0 additions & 3 deletions test/parallel/test-repl-underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ function testError() {
// The message from the original throw
'Thrown:',
'Error: baz',
/setImmediate/,
/^ at/,
/^ at/,
];
for (const line of lines) {
const expected = expectedLines.shift();
Expand Down

0 comments on commit 38ad285

Please sign in to comment.