Skip to content

Commit

Permalink
fix: replace crypto with crypto-js for Angular apps (#67)
Browse files Browse the repository at this point in the history
* fix: replace crypto with crypto-js for Angular apps

Signed-off-by: Adrian Ali <aali@forbes.com>

* remove package-lock.json file

Signed-off-by: Adrian Ali <aali@forbes.com>

* fix: prettier, lock file

Co-authored-by: Shelex <ovr.shevtsov@gmail.com>
  • Loading branch information
aali0730 and Shelex authored Apr 26, 2021
1 parent e030984 commit 558d1a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"dependencies": {
"allure-js-commons": "^2.0.0-beta.6",
"crypto-js": "3.3.0",
"uuid": "^7.0.2"
},
"devDependencies": {
Expand All @@ -55,4 +56,4 @@
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}
}
}
8 changes: 4 additions & 4 deletions reporter/mocha-allure/AllureReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

const { LabelName, Stage, Status } = require('allure-js-commons');
const { createHash } = require('crypto');
var crypto = require('crypto-js');
const AllureInterface = require('./AllureInterface');
const { tagToLabel, tagToLink } = require('../gherkinToLabel');
const { languageLabel } = require('../languageLabel');
Expand Down Expand Up @@ -149,9 +149,9 @@ module.exports = class AllureReporter {
this.commands = [];
this.currentTest = this.currentSuite.startTest(test.title);
this.currentTest.fullName = test.title;
this.currentTest.historyId = createHash('md5')
.update(test.fullTitle())
.digest('hex');
this.currentTest.historyId = crypto
.MD5(test.fullTitle())
.toString(crypto.enc.Hex);
this.currentTest.stage = Stage.RUNNING;

if (
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2576,6 +2576,11 @@ crypto-browserify@^3.0.0:
randombytes "^2.0.0"
randomfill "^1.0.3"

crypto-js@3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.3.0.tgz#846dd1cce2f68aacfa156c8578f926a609b7976b"
integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==

crypto-random-string@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e"
Expand Down

0 comments on commit 558d1a0

Please sign in to comment.