From 2e2e8020e7cc2019868d858aba84f136ad8c3c8b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 17 Oct 2017 14:51:57 -0700 Subject: [PATCH] test: make test-buffer-slow engine agnostic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not check the error message if it is generated by the JavaScript engine (V8, ChakraCore, etc.). Do confirm that it is a `RangeError`. PR-URL: https://github.com/nodejs/node/pull/16272 Reviewed-By: Michaël Zasso Reviewed-By: Refael Ackermann Reviewed-By: Yuta Hiroto Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Tobias Nießen --- test/parallel/test-buffer-slow.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index d08681cc2c16d4..8889d8d77de135 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -34,7 +34,9 @@ try { assert.strictEqual( SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength); } catch (e) { - assert.strictEqual(e.message, 'Array buffer allocation failed'); + // Don't match on message as it is from the JavaScript engine. V8 and + // ChakraCore provide different messages. + assert.strictEqual(e.name, 'RangeError'); } // should work with number-coercible values