test: fix tests after V8 update

Adapt to changes in async stack traces and function name inference

PR-URL: https://github.com/nodejs/node/pull/25852
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
This commit is contained in:
Michaël Zasso 2019-01-18 09:38:22 +01:00
parent 260d5f8c3b
commit 38ad285a2e
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600
9 changed files with 19 additions and 17 deletions

View File

@ -3,4 +3,5 @@ file:///*/test/message/esm_display_syntax_error.mjs:3
await async () => 0; await async () => 0;
^^^^^ ^^^^^
SyntaxError: Unexpected reserved word 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:*:*)

View File

@ -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' 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 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:*:*)

View File

@ -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' SyntaxError: The requested module './module-named-exports' does not provide an export named 'notfound'
at ModuleJob._instantiate (internal/modules/esm/module_job.js:*:*) 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:*:*)

View File

@ -3,4 +3,4 @@ file:///*/test/fixtures/es-module-loaders/syntax-error.mjs:2
await async () => 0; await async () => 0;
^^^^^ ^^^^^
SyntaxError: Unexpected reserved word SyntaxError: Unexpected reserved word
at translators.set (internal/modules/esm/translators.js:*:*) at internal/modules/esm/translators.js:*:*

View File

@ -12,7 +12,7 @@ Error
at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*)
at internal/main/run_main_module.js:*:* at internal/main/run_main_module.js:*:*
Emitted 'error' event at: 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 processTicksAndRejections (internal/process/task_queues.js:*:*)
at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:*:*) at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:*:*)
at Function.Module.runMain (internal/modules/cjs/loader.js:*:*) at Function.Module.runMain (internal/modules/cjs/loader.js:*:*)

View File

@ -10,8 +10,8 @@ SyntaxError: Strict mode code may not include a with statement
at Object.<anonymous> ([stdin]-wrapper:*:*) at Object.<anonymous> ([stdin]-wrapper:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*)
at evalScript (internal/process/execution.js:*:*) at evalScript (internal/process/execution.js:*:*)
at readStdin (internal/main/eval_stdin.js:*:*) at internal/main/eval_stdin.js:*:*
at Socket.process.stdin.on (internal/process/execution.js:*:*) at Socket.<anonymous> (internal/process/execution.js:*:*)
at Socket.emit (events.js:*:*) at Socket.emit (events.js:*:*)
at endReadableNT (_stream_readable.js:*:*) at endReadableNT (_stream_readable.js:*:*)
42 42
@ -27,8 +27,8 @@ Error: hello
at Object.<anonymous> ([stdin]-wrapper:*:*) at Object.<anonymous> ([stdin]-wrapper:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*)
at evalScript (internal/process/execution.js:*:*) at evalScript (internal/process/execution.js:*:*)
at readStdin (internal/main/eval_stdin.js:*:*) at internal/main/eval_stdin.js:*:*
at Socket.process.stdin.on (internal/process/execution.js:*:*) at Socket.<anonymous> (internal/process/execution.js:*:*)
at Socket.emit (events.js:*:*) at Socket.emit (events.js:*:*)
at endReadableNT (_stream_readable.js:*:*) at endReadableNT (_stream_readable.js:*:*)
[stdin]:1 [stdin]:1
@ -42,8 +42,8 @@ Error: hello
at Object.<anonymous> ([stdin]-wrapper:*:*) at Object.<anonymous> ([stdin]-wrapper:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*)
at evalScript (internal/process/execution.js:*:*) at evalScript (internal/process/execution.js:*:*)
at readStdin (internal/main/eval_stdin.js:*:*) at internal/main/eval_stdin.js:*:*
at Socket.process.stdin.on (internal/process/execution.js:*:*) at Socket.<anonymous> (internal/process/execution.js:*:*)
at Socket.emit (events.js:*:*) at Socket.emit (events.js:*:*)
at endReadableNT (_stream_readable.js:*:*) at endReadableNT (_stream_readable.js:*:*)
100 100
@ -58,8 +58,8 @@ ReferenceError: y is not defined
at Object.<anonymous> ([stdin]-wrapper:*:*) at Object.<anonymous> ([stdin]-wrapper:*:*)
at Module._compile (internal/modules/cjs/loader.js:*:*) at Module._compile (internal/modules/cjs/loader.js:*:*)
at evalScript (internal/process/execution.js:*:*) at evalScript (internal/process/execution.js:*:*)
at readStdin (internal/main/eval_stdin.js:*:*) at internal/main/eval_stdin.js:*:*
at Socket.process.stdin.on (internal/process/execution.js:*:*) at Socket.<anonymous> (internal/process/execution.js:*:*)
at Socket.emit (events.js:*:*) at Socket.emit (events.js:*:*)
at endReadableNT (_stream_readable.js:*:*) at endReadableNT (_stream_readable.js:*:*)

View File

@ -35,5 +35,5 @@
at promiseRejectHandler (internal/process/promises.js:*) at promiseRejectHandler (internal/process/promises.js:*)
at Promise.then * at Promise.then *
at Promise.catch * at Promise.catch *
at Immediate.setImmediate (*test*message*unhandled_promise_trace_warnings.js:*) at Immediate.<anonymous> (*test*message*unhandled_promise_trace_warnings.js:*)
at * at *

View File

@ -10,13 +10,13 @@ const {
{ {
// Intentional non-op. Do not wrap in common.mustCall(); // 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 obs = new PerformanceObserver(common.mustCall((list) => {
const entries = list.getEntries(); const entries = list.getEntries();
const entry = entries[0]; const entry = entries[0];
assert(entry); assert(entry);
assert.strictEqual(entry.name, 'performance.timerify'); assert.strictEqual(entry.name, 'noop');
assert.strictEqual(entry.entryType, 'function'); assert.strictEqual(entry.entryType, 'function');
assert.strictEqual(typeof entry.duration, 'number'); assert.strictEqual(typeof entry.duration, 'number');
assert.strictEqual(typeof entry.startTime, 'number'); assert.strictEqual(typeof entry.startTime, 'number');

View File

@ -195,9 +195,6 @@ function testError() {
// The message from the original throw // The message from the original throw
'Thrown:', 'Thrown:',
'Error: baz', 'Error: baz',
/setImmediate/,
/^ at/,
/^ at/,
]; ];
for (const line of lines) { for (const line of lines) {
const expected = expectedLines.shift(); const expected = expectedLines.shift();