Skip to content

Commit 2f726e7

Browse files
committed
chore: update tests
1 parent 5b04903 commit 2f726e7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

test/unit/node/util.test.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -149,28 +149,29 @@ describe("getEnvPaths", () => {
149149
})
150150

151151
describe("hash", () => {
152-
it("should return a hash of the string passed in", () => {
152+
it("should return a hash of the string passed in", async () => {
153153
const plainTextPassword = "mySecretPassword123"
154-
const hashed = hash(plainTextPassword)
154+
const hashed = await hash(plainTextPassword)
155155
expect(hashed).not.toBe(plainTextPassword)
156156
})
157157
})
158158

159159
describe("isHashMatch", () => {
160-
it("should return true if the password matches the hash", () => {
160+
it("should return true if the password matches the hash", async () => {
161161
const password = "password123"
162-
const _hash = hash(password)
162+
const _hash = await hash(password)
163163
expect(isHashMatch(password, _hash)).toBe(true)
164164
})
165-
it("should return false if the password does not match the hash", () => {
165+
it("should return false if the password does not match the hash", async () => {
166166
const password = "password123"
167-
const _hash = hash(password)
167+
const _hash = await hash(password)
168168
expect(isHashMatch("otherPassword123", _hash)).toBe(false)
169169
})
170-
it("should return true with actual hash", () => {
170+
it("should return true with actual hash", async () => {
171171
const password = "password"
172172
const _hash = "$2b$10$GA/eZnlboeV9eW8LnntPqe1dZE7tQ/./wCdc7NgJhMRB.xhaJfmG."
173-
expect(isHashMatch(password, _hash)).toBe(true)
173+
const actual = await isHashMatch(password, _hash)
174+
expect(actual).toBe(true)
174175
})
175176
})
176177

0 commit comments

Comments
 (0)