File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { JSDOM } from "jsdom"
4
4
import { logger } from "../node_modules/@coder/logger"
5
5
import {
6
6
arrayify ,
7
+ generateUuid ,
7
8
getFirstString ,
8
9
getOptions ,
9
10
logError ,
@@ -55,6 +56,20 @@ describe("util", () => {
55
56
} )
56
57
} )
57
58
59
+ describe ( "generateUuid" , ( ) => {
60
+ it ( "should generate a unique uuid" , ( ) => {
61
+ const uuid = generateUuid ( )
62
+ const uuid2 = generateUuid ( )
63
+ expect ( uuid ) . toHaveLength ( 24 )
64
+ expect ( typeof uuid ) . toBe ( "string" )
65
+ expect ( uuid ) . not . toBe ( uuid2 )
66
+ } )
67
+ it ( "should generate a uuid of a specific length" , ( ) => {
68
+ const uuid = generateUuid ( 10 )
69
+ expect ( uuid ) . toHaveLength ( 10 )
70
+ } )
71
+ } )
72
+
58
73
describe ( "trimSlashes" , ( ) => {
59
74
it ( "should remove leading slashes" , ( ) => {
60
75
expect ( trimSlashes ( "/hello-world" ) ) . toBe ( "hello-world" )
You can’t perform that action at this time.
0 commit comments