Skip to content

Commit

Permalink
nodejs#47707 migrated tests/message to JS fixture tests
Browse files Browse the repository at this point in the history
  • Loading branch information
projectnoa committed May 5, 2023
1 parent 212821a commit 6089c18
Show file tree
Hide file tree
Showing 57 changed files with 620 additions and 214 deletions.
562 changes: 562 additions & 0 deletions deps/zlib/zconf.h.included

Large diffs are not rendered by default.

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
Expand Up @@ -19,9 +19,9 @@ 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 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 *
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
Expand Up @@ -7,7 +7,7 @@ Please open an issue with this stack trace at https://github.com/nodejs/node/iss

at new NodeError (node:internal/errors:*:*)
at assert (node:internal/assert:*:*)
at * (*test*message*internal_assert.js:7:1)
at * (*test*fixtures*assertion*internal_assert.js:7:1)
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
Expand Up @@ -8,7 +8,7 @@ Please open an issue with this stack trace at https://github.com/nodejs/node/iss

at new NodeError (node:internal/errors:*:*)
at Function.fail (node:internal/assert:*:*)
at * (*test*message*internal_assert_fail.js:7:8)
at * (*test*fixtures*assertion*internal_assert_fail.js:7:8)
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ node:punycode:49
RangeError: Invalid input
at error (node:punycode:49:8)
at Object.decode (node:punycode:*:*)
at Object.<anonymous> (*test*message*core_line_numbers.js:*:*)
at Object.<anonymous> (*test*fixtures*console*core_line_numbers.js:*:*)

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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
@@ -1,5 +1,7 @@
'use strict';
require('../common');

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

throw { // eslint-disable-line no-throw-literal
get stack() {
throw new Error('weird throw but ok');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

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

// eslint-disable-next-line no-throw-literal
throw null;
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

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

// eslint-disable-next-line no-throw-literal
throw undefined;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

*test*message*throw_undefined.js:*
*test*fixtures*errors*throw_undefined.js:*
throw undefined;
^
undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

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

setTimeout(function() {
// eslint-disable-next-line no-undef,no-unused-expressions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
*test*message*timeout_throw.js:*
*test*fixtures*errors*timeout_throw.js:*
undefined_reference_error_maker;
^
ReferenceError: undefined_reference_error_maker is not defined
at Timeout._onTimeout (*test*message*timeout_throw.js:*:*)
at Timeout._onTimeout (*test*fixtures*errors*timeout_throw.js:*:*)
at listOnTimeout (node:internal/timers:*:*)
at process.processTimers (node:internal/timers:*:*)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
require('../common');
require('../../common');
const vm = require('vm');

console.error('before');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ ReferenceError: foo is not defined
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:*)
at Object.<anonymous> (*test*fixtures*errors*undefined_reference_in_new_context.js:*)

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

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

const { inspect } = require('util');

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

require('../common');
require('../../common');
const util = require('util');

const err = new Error('foo\nbar');
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

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

function AsmModule() {
'use asm';
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions test/fixtures/map/source_map_enclosing_function.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Flags: --enable-source-maps

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

require('../source-map/enclosing-call-site-min.js');
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Flags: --enable-source-maps

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

require('../fixtures/source-map/tabs.js');
require('../source-map/tabs.js');
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Flags: --enable-source-maps

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

try {
require('../fixtures/source-map/typescript-sourcemapping_url_string');
require('../source-map/typescript-sourcemapping_url_string');
} catch (err) {
setTimeout(() => {
console.info(err);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Error: an exception.
at *typescript-sourcemapping_url_string.ts:3:7*
at Object.<anonymous> (*typescript-sourcemapping_url_string.ts:3:7)
at Module._compile (node:internal/modules/cjs/loader:*)
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Flags: --enable-source-maps

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

try {
require('../fixtures/source-map/typescript-throw');
require('../source-map/typescript-throw');
} catch (err) {
setTimeout(() => {
console.info(err);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Flags: --enable-source-maps

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

require('../fixtures/source-map/icu');
require('../source-map/icu');
File renamed without changes.
5 changes: 5 additions & 0 deletions test/fixtures/map/source_map_throw_set_immediate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Flags: --enable-source-maps

'use strict';
require('../../common');
require('../source-map/uglify-throw');
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Flags: --unhandled-rejections=warn-with-error-code
'use strict';

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

Promise.reject(new Error('alas'));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Flags: --trace-warnings --unhandled-rejections=warn
'use strict';
require('../common');
require('../../common');
const p = Promise.reject(new Error('This was rejected'));
setImmediate(() => p.catch(() => {}));
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(node:*) UnhandledPromiseRejectionWarning: Error: This was rejected
at * (*test*message*unhandled_promise_trace_warnings.js:*)
at * (*test*fixtures*promise*unhandled_promise_trace_warnings.js:*)
at *
at *
at *
Expand All @@ -10,7 +10,7 @@
at *
at *
(node:*) Error: This was rejected
at * (*test*message*unhandled_promise_trace_warnings.js:*)
at * (*test*fixtures*promise*unhandled_promise_trace_warnings.js:*)
at *
at *
at *
Expand All @@ -22,5 +22,5 @@
at promiseRejectHandler (node:internal/process/promises:*)
at Promise.then *
at Promise.catch *
at Immediate.<anonymous> (*test*message*unhandled_promise_trace_warnings.js:*)
at Immediate.<anonymous> (*test*fixtures*promise*unhandled_promise_trace_warnings.js:*)
at *
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

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

process.maxTickDepth = 10;
let i = 20;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

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

process.nextTick(function() {
process.nextTick(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

*test*message*nexttick_throw.js:*
*test*fixtures*tick*nexttick_throw.js:*
undefined_reference_error_maker;
^
ReferenceError: undefined_reference_error_maker is not defined
at *test*message*nexttick_throw.js:*:*
at *test*fixtures*tick*nexttick_throw.js:*:*
at process.processTicksAndRejections (node:internal/process/task_queues:*:*)

Node.js *
19 changes: 0 additions & 19 deletions test/message/message.status

This file was deleted.

7 changes: 0 additions & 7 deletions test/message/source_map_enclosing_function.js

This file was deleted.

5 changes: 0 additions & 5 deletions test/message/source_map_throw_set_immediate.js

This file was deleted.

Loading

0 comments on commit 6089c18

Please sign in to comment.