From fefbbd90af29ccd68564c3b7d911c5f5e5a47c21 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 25 Apr 2019 00:25:32 +0200 Subject: [PATCH] test: add tests for new language features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/27400 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso --- test/parallel/test-assert.js | 4 ++-- test/parallel/test-repl.js | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 62ed50f6a43fa9..003e67b380d88d 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 f9f5d196aa3e6b..c0869c84b30b71 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 {