File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 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"
44import { logger } from "../node_modules/@coder/logger"
55import {
66 arrayify ,
7+ generateUuid ,
78 getFirstString ,
89 getOptions ,
910 logError ,
@@ -55,6 +56,20 @@ describe("util", () => {
5556 } )
5657 } )
5758
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+
5873 describe ( "trimSlashes" , ( ) => {
5974 it ( "should remove leading slashes" , ( ) => {
6075 expect ( trimSlashes ( "/hello-world" ) ) . toBe ( "hello-world" )
You can’t perform that action at this time.
0 commit comments