From dfed1a4b4586e4524a1f2171e84c334a73265060 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 1 Jun 2020 08:07:25 +0200 Subject: [PATCH] switching webcrypto library to native node crypto implementation (requires node>=10) --- js/common.js | 2 +- js/package.json | 2 +- tst/README.md | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/common.js b/js/common.js index d39e0b7..6c44a32 100644 --- a/js/common.js +++ b/js/common.js @@ -7,7 +7,7 @@ global.jsdom = require('jsdom-global'); global.cleanup = global.jsdom(); global.URL = require('jsdom-url').URL; global.fs = require('fs'); -global.WebCrypto = require('node-webcrypto-ossl'); +global.WebCrypto = require('@peculiar/webcrypto').Crypto; // application libraries to test global.$ = global.jQuery = require('./jquery-3.4.1'); diff --git a/js/package.json b/js/package.json index 516eb6f..489cc67 100644 --- a/js/package.json +++ b/js/package.json @@ -12,7 +12,7 @@ "jsdom-global": "^2.1.1", "jsdom-url": "^2.2.1", "jsverify": "^0.8.3", - "node-webcrypto-ossl": "^1.0.37" + "@peculiar/webcrypto": "^1.1.1" }, "scripts": { "test": "mocha" diff --git a/tst/README.md b/tst/README.md index 340f61f..c8bb751 100644 --- a/tst/README.md +++ b/tst/README.md @@ -104,7 +104,8 @@ $ cd PrivateBin/js $ npm install ``` -To run the tests, just change into the `js` directory and run istanbul: +To run the tests, just change into the `js` directory and run nyc (will produce +coverage report) or just mocha: ```console $ cd PrivateBin/js