From 3883e3fb301a44447a5aa7b0269eb003c335468e Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 24 Dec 2018 08:19:58 +0100 Subject: [PATCH] adjusting test to make it work in latest jsDOM versions that don't support arbitrary bytes in a URLs hash anymore --- js/test/Helper.js | 10 ++++++---- tst/README.md | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/js/test/Helper.js b/js/test/Helper.js index 44d6bcca..3043300d 100644 --- a/js/test/Helper.js +++ b/js/test/Helper.js @@ -243,12 +243,14 @@ describe('Helper', function () { 'returns the URL without query & fragment', jsc.elements(['http', 'https']), jsc.nearray(common.jscA2zString()), + jsc.array(common.jscA2zString()), jsc.array(common.jscQueryString()), - 'asciistring', - function (schema, address, query, fragment) { + jsc.array(common.jscA2zString()), + function (schema, address, path, query, fragment) { $.PrivateBin.Helper.reset(); - var expected = schema + '://' + address.join('') + '/', - clean = jsdom('', {url: expected + '?' + query.join('') + '#' + fragment}), + var path = path.join('') + (path.length > 0 ? '/' : ''), + expected = schema + '://' + address.join('') + '/' + path, + clean = jsdom('', {url: expected + '?' + query.join('') + '#' + fragment.join('')}), result = $.PrivateBin.Helper.baseUri(); clean(); return expected === result; diff --git a/tst/README.md b/tst/README.md index a95a27bd..66ec5639 100644 --- a/tst/README.md +++ b/tst/README.md @@ -51,7 +51,7 @@ and jsdom-global locally: ```console $ npm install -g mocha istanbul $ cd PrivateBin/js -$ npm install jsverify jsdom@9 jsdom-global@2 mime-types +$ npm install jsverify jsdom@9 jsdom-global@2 mime-types node-webcrypto-ossl ``` Example for Debian and Ubuntu, including steps to allow the current user to @@ -63,7 +63,7 @@ $ sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share} $ ln -s /usr/bin/nodejs /usr/local/bin/node $ npm install -g mocha istanbul $ cd PrivateBin/js -$ npm install jsverify jsdom@9 jsdom-global@2 mime-types +$ npm install jsverify jsdom@9 jsdom-global@2 mime-types node-webcrypto-ossl ``` To run the tests, just change into the `js` directory and run istanbul: