From 81e2eac7ba73d63cc160e303d5d1060e607f8399 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 15 Jan 2020 15:16:46 -0500 Subject: [PATCH] test: update BigInt test for recent change in core https://github.com/nodejs/node/commit/689ab46c646bc8add5560a606ba73d3760f8f924 changed the expected error for one of the BigInt test cases. This is ok because BigInt is still in experimental. However, the result was a failed/hanging test. See https://github.com/nodejs/build/issues/2131 This changes the test to accept either the new or old behaviour. We need that so that older versions of Node.js will also pass the test until the the node core commit above is backported. PR-URL: https://github.com/nodejs/node-addon-api/pull/649 Reviewed-By: Gabriel Schulhof Reviewed-By: Nicola Del Gobbo --- test/bigint.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/bigint.js b/test/bigint.js index e4255172c..0af867b43 100644 --- a/test/bigint.js +++ b/test/bigint.js @@ -46,7 +46,7 @@ function test(binding) { }); assert.throws(TestTooBigBigInt, { - name: 'RangeError', - message: 'Maximum BigInt size exceeded', + name: /^(RangeError|Error)$/, + message: /^(Maximum BigInt size exceeded|Invalid argument)$/, }); }