diff --git a/build/build.browser.tests.js b/build/build.browser.tests.js index afd481b..b41f66e 100644 --- a/build/build.browser.tests.js +++ b/build/build.browser.tests.js @@ -9,6 +9,9 @@ const multiEntry = require('rollup-plugin-multi-entry'); const fs = require('fs'); const path = require('path'); const pkgJson = require('../package.json'); +const pkg_name = pkgJson.name; +const mocha_version = pkgJson.devDependencies.mocha.replace(/[\^~*><=]/g, ''); +const chai_version = pkgJson.devDependencies.chai.replace(/[\^~*><=]/g, ''); const rootDir = path.join(__dirname, '..'); @@ -21,13 +24,16 @@ const dstFileName = path.join(dstDir, 'index.html'); const template = fs.readFileSync(templatePath, 'utf-8'); const testsJs = ` `; -fs.writeFileSync(dstFileName, template.replace('{{TESTS}}', testsJs).replace('{{PKG_NAME}}', pkgJson.name)); + +fs.writeFileSync(dstFileName, + template.replace(/{{TESTS}}/g, testsJs).replace(/{{PKG_NAME}}/g, pkgJson.name).replace(/{{MOCHA_VERSION}}/g, mocha_version).replace(/{{CHAI_VERSION}}/g, chai_version) +); /* Now we create a bundle of all the tests called test.js diff --git a/package.json b/package.json index b180e09..f24d3c8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bigint-crypto-utils", "version": "2.4.3", - "description": "Utils for working with cryptography using native JS (stage 3) implementation of BigInt. It includes arbitrary precision modular arithmetics, cryptographically secure random numbers and strong probable prime generation/testing.", + "description": "Utils for working with cryptography using native JS implementation of BigInt. It includes arbitrary precision modular arithmetics, cryptographically secure random numbers and strong probable prime generation/testing.", "keywords": [ "modular arithmetics", "crypto", diff --git a/src/browser-test-template.html b/src/browser-test-template.html index 6795d1c..e8bdd3b 100644 --- a/src/browser-test-template.html +++ b/src/browser-test-template.html @@ -2,12 +2,12 @@