aboutsummaryrefslogtreecommitdiff
path: root/test/parallel
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-04-25 00:25:32 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2019-04-30 16:22:57 +0200
commit3d2409c476e52d0ca8729f161eedf98ece37063e (patch)
tree78a5be14c2414e3b64e311c2346c607bb56df35d /test/parallel
parente939b8f13b311fcc39d7806537a5c768f37bb0d0 (diff)
downloadandroid-node-v8-3d2409c476e52d0ca8729f161eedf98ece37063e.tar.gz
android-node-v8-3d2409c476e52d0ca8729f161eedf98ece37063e.tar.bz2
android-node-v8-3d2409c476e52d0ca8729f161eedf98ece37063e.zip
test: add tests for new language features
PR-URL: https://github.com/nodejs/node/pull/27400 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'test/parallel')
-rw-r--r--test/parallel/test-assert.js4
-rw-r--r--test/parallel/test-repl.js19
2 files changed, 19 insertions, 4 deletions
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js
index 62ed50f6a4..003e67b380 100644
--- a/test/parallel/test-assert.js
+++ b/test/parallel/test-assert.js
@@ -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"
}
);
diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js
index f9f5d196aa..c0869c84b3 100644
--- a/test/parallel/test-repl.js
+++ b/test/parallel/test-repl.js
@@ -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() {',
@@ -338,12 +353,12 @@ const errorTests = [
expect: '... '
},
{
- send: 'return 1;',
+ send: 'return 1n;',
expect: '... '
},
{
send: '})()',
- expect: '1'
+ expect: '1n'
},
// Multiline function call
{