From 7a8eddf015362f1b88a094fcf205cc4a82d7a0d3 Mon Sep 17 00:00:00 2001 From: Zhang Weijie Date: Sun, 16 Jul 2017 15:13:34 +0800 Subject: [PATCH] test: use regex error check in test-crypto-random MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace constructor in assert.throws() to a regular expression to check the error thrown in a test in test-crypto-random. PR-URL: https://github.com/nodejs/node/pull/14273 Reviewed-By: Rich Trott Reviewed-By: Gibson Fahnestock Reviewed-By: Evan Lucas Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell --- test/parallel/test-crypto-random.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-crypto-random.js b/test/parallel/test-crypto-random.js index 7fa5c71c3ce05d..a664023e81c06b 100644 --- a/test/parallel/test-crypto-random.js +++ b/test/parallel/test-crypto-random.js @@ -32,4 +32,4 @@ const expectedErrorRegexp = /^TypeError: size must be a number >= 0$/; // length exceeds max acceptable value" assert.throws(function() { crypto.randomBytes((-1 >>> 0) + 1); -}, TypeError); +}, /^TypeError: size must be a number >= 0$/);