From a9e035e5722f76bbd08f39a1a2e4fa37d4a6072a Mon Sep 17 00:00:00 2001 From: Morten Olsrud Date: Tue, 1 May 2018 21:39:06 +0200 Subject: [PATCH] Fixed node-tests to accomodate optional parameters in "define" --- tests/node-test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/node-test.js b/tests/node-test.js index a232558..2191638 100644 --- a/tests/node-test.js +++ b/tests/node-test.js @@ -67,7 +67,10 @@ JS_SHA256_NO_NODE_JS = true; JS_SHA256_NO_COMMON_JS = true; JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW = false; window = global; -define = function (func) { +define = function (id, func) { + if(typeof(id) == "function" && typeof(func) == "undefined" ){ + func = id; + } sha256 = func(); sha224 = sha256.sha224; require('./test.js');