Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit df6ee08

Browse files
committed
test: refactor test snapshots
1 parent a93af84 commit df6ee08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/utils/src/generate-id.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
export function genId(size = 3) {
22
let uuid = ""
3-
const dictionary = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
3+
const dictionary =
4+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
45
for (let i = 0; i < size; i++) {
56
uuid += dictionary.charAt(Math.floor(Math.random() * dictionary.length))
67
}
8+
if (process.env.NODE_ENV === "test") return "GENERATED_TEST_ID"
79
return uuid
810
}

0 commit comments

Comments
 (0)