Skip to content

Commit fefbbd9

Browse files
BridgeARtargos
authored andcommitted
test: add tests for new language features
PR-URL: #27400 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 05cea67 commit fefbbd9

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

test/parallel/test-assert.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -631,13 +631,13 @@ common.expectsError(
631631
}
632632
);
633633
common.expectsError(
634-
() => assert(typeof 123 === 'string'),
634+
() => assert(typeof 123n === 'string'),
635635
{
636636
code: 'ERR_ASSERTION',
637637
type: assert.AssertionError,
638638
generatedMessage: true,
639639
message: 'The expression evaluated to a falsy value:\n\n ' +
640-
"assert(typeof 123 === 'string')\n"
640+
"assert(typeof 123n === 'string')\n"
641641
}
642642
);
643643

test/parallel/test-repl.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,21 @@ const errorTests = [
328328
send: '1 }',
329329
expect: '{ a: 1 }'
330330
},
331+
// Multiline class with private member.
332+
{
333+
send: 'class Foo { #private = true ',
334+
expect: '... '
335+
},
336+
// Class field with bigint.
337+
{
338+
send: 'num = 123456789n',
339+
expect: '... '
340+
},
341+
// Static class features.
342+
{
343+
send: 'static foo = "bar" }',
344+
expect: 'undefined'
345+
},
331346
// Multiline anonymous function with comment
332347
{
333348
send: '(function() {',
@@ -338,12 +353,12 @@ const errorTests = [
338353
expect: '... '
339354
},
340355
{
341-
send: 'return 1;',
356+
send: 'return 1n;',
342357
expect: '... '
343358
},
344359
{
345360
send: '})()',
346-
expect: '1'
361+
expect: '1n'
347362
},
348363
// Multiline function call
349364
{

0 commit comments

Comments
 (0)