Skip to content

Commit

Permalink
test: add tests for new language features
Browse files Browse the repository at this point in the history
PR-URL: #27400
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
BridgeAR authored and targos committed Apr 30, 2019
1 parent 05cea67 commit fefbbd9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,13 @@ common.expectsError(
}
);
common.expectsError(
() => assert(typeof 123 === 'string'),
() => assert(typeof 123n === 'string'),
{
code: 'ERR_ASSERTION',
type: assert.AssertionError,
generatedMessage: true,
message: 'The expression evaluated to a falsy value:\n\n ' +
"assert(typeof 123 === 'string')\n"
"assert(typeof 123n === 'string')\n"
}
);

Expand Down
19 changes: 17 additions & 2 deletions test/parallel/test-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,21 @@ const errorTests = [
send: '1 }',
expect: '{ a: 1 }'
},
// Multiline class with private member.
{
send: 'class Foo { #private = true ',
expect: '... '
},
// Class field with bigint.
{
send: 'num = 123456789n',
expect: '... '
},
// Static class features.
{
send: 'static foo = "bar" }',
expect: 'undefined'
},
// Multiline anonymous function with comment
{
send: '(function() {',
Expand All @@ -338,12 +353,12 @@ const errorTests = [
expect: '... '
},
{
send: 'return 1;',
send: 'return 1n;',
expect: '... '
},
{
send: '})()',
expect: '1'
expect: '1n'
},
// Multiline function call
{
Expand Down

0 comments on commit fefbbd9

Please sign in to comment.