Skip to content

Commit 351e688

Browse files
committed
refactor: use bcrypt in e2e setup
1 parent ac447fa commit 351e688

File tree

3 files changed

+262
-10
lines changed

3 files changed

+262
-10
lines changed

test/config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import {
88
Config,
99
globalSetup,
1010
} from "@playwright/test"
11-
import * as crypto from "crypto"
11+
import * as bcrypt from "bcrypt"
1212
import path from "path"
1313
import { PASSWORD } from "./utils/constants"
1414
import * as wtfnode from "./utils/wtfnode"
1515

1616
// Playwright doesn't like that ../src/node/util has an enum in it
1717
// so I had to copy hash in separately
1818
const hash = (str: string): string => {
19-
return crypto.createHash("sha256").update(str).digest("hex")
19+
return bcrypt.hashSync(str, 10)
2020
}
2121

2222
const cookieToStore = {

test/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
"#": "We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha.",
44
"devDependencies": {
55
"@playwright/test": "^0.1101.0-alpha2",
6+
"@types/bcrypt": "^5.0.0",
67
"@types/jest": "^26.0.20",
78
"@types/jsdom": "^16.2.6",
89
"@types/node-fetch": "^2.5.8",
910
"@types/supertest": "^2.0.10",
11+
"bcrypt": "^5.0.1",
1012
"jest": "^26.6.3",
1113
"jsdom": "^16.4.0",
1214
"node-fetch": "^2.6.1",

0 commit comments

Comments
 (0)