From 26790983efdbec42333fe6e11f5064aed70d5c39 Mon Sep 17 00:00:00 2001 From: Kyle Farnung Date: Fri, 11 Aug 2017 14:15:16 -0700 Subject: [PATCH] test: fix chakracore test failures * addons-napi/test_properties: Fixed message comparison * inspector/test-inspector-stop-profile-after-done: Marked unsupported test flaky * parallel/test-assert: Fixed message comparison * parallel/test-console-count: Fixed message comparison * parallel/test-crypto-dh-leak: Marked unsupported test flaky PR-URL: https://github.com/nodejs/node-chakracore/pull/365 Reviewed-By: Hitesh Kanwathirtha --- test/addons-napi/test_properties/test.js | 5 ++++- test/inspector/inspector.status | 2 +- test/parallel/parallel.status | 1 + test/parallel/test-assert.js | 5 ++++- test/parallel/test-console-count.js | 14 +++++++++++--- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/test/addons-napi/test_properties/test.js b/test/addons-napi/test_properties/test.js index 0a3bbee8536..1e0381b55d6 100644 --- a/test/addons-napi/test_properties/test.js +++ b/test/addons-napi/test_properties/test.js @@ -1,7 +1,10 @@ 'use strict'; const common = require('../../common'); const assert = require('assert'); -const readonlyErrorRE = /^TypeError: Cannot assign to read only property '.*' of object '#'$/; +const readonlyErrorRE = common.engineSpecificMessage({ + v8: /^TypeError: Cannot assign to read only property '.*' of object '#'$/, + chakracore: /^TypeError: Assignment to read-only properties is not allowed in strict mode$/ +}); // Testing api calls for defining properties const test_object = require(`./build/${common.buildType}/test_properties`); diff --git a/test/inspector/inspector.status b/test/inspector/inspector.status index dc560fbfcad..209252be9f6 100644 --- a/test/inspector/inspector.status +++ b/test/inspector/inspector.status @@ -11,5 +11,5 @@ prefix inspector [$jsEngine==chakracore] test-bindings : PASS,FLAKY test-inspector-break-when-eval : PASS,FLAKY +test-inspector-stop-profile-after-done : PASS,FLAKY test-off-with-session-then-on : PASS,FLAKY - diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index fd1b7883f5e..fdaf4edc296 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -41,6 +41,7 @@ test-buffer-sharedarraybuffer : PASS,FLAKY test-child-process-promisified : PASS,FLAKY test-cluster-inspector-debug-port : PASS,FLAKY test-crypto-dh : PASS,FLAKY +test-crypto-dh-leak : PASS,FLAKY test-debugger-repeat-last : PASS,FLAKY test-domain-no-error-handler-abort-on-uncaught-0 : PASS,FLAKY test-domain-no-error-handler-abort-on-uncaught-1 : PASS,FLAKY diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index ab45aa6c4b6..407bd30c43e 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -41,7 +41,10 @@ assert.throws( () => { assert.throws(() => { throw new Error(); }, { foo: 'bar' }); }, common.expectsError({ type: TypeError, - message: 'expected.test is not a function' + message: common.engineSpecificMessage({ + v8: 'expected.test is not a function', + chakracore: 'Object doesn\'t support property or method \'test\'' + }) }) ); diff --git a/test/parallel/test-console-count.js b/test/parallel/test-console-count.js index 64e2641f0a6..3749ff778ca 100644 --- a/test/parallel/test-console-count.js +++ b/test/parallel/test-console-count.js @@ -1,6 +1,6 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const stdoutWrite = process.stdout.write; @@ -57,7 +57,15 @@ process.stdout.write = stdoutWrite; // Symbol labels do not work assert.throws( () => console.count(Symbol('test')), - /^TypeError: Cannot convert a Symbol value to a string$/); + common.engineSpecificMessage({ + v8: /^TypeError: Cannot convert a Symbol value to a string$/, + chakracore: /^TypeError: Object doesn't support property or method 'ToString'$/ + }) +); assert.throws( () => console.countReset(Symbol('test')), - /^TypeError: Cannot convert a Symbol value to a string$/); + common.engineSpecificMessage({ + v8: /^TypeError: Cannot convert a Symbol value to a string$/, + chakracore: /^TypeError: Object doesn't support property or method 'ToString'$/ + }) +);