@@ -24,16 +24,6 @@ describe("util", () => {
2424 } )
2525 } )
2626
27- describe ( "split" , ( ) => {
28- it ( "should split at a comma" , ( ) => {
29- expect ( util . split ( "Hello,world" , "," ) ) . toStrictEqual ( [ "Hello" , "world" ] )
30- } )
31-
32- it ( "shouldn't split if the delimiter doesn't exist" , ( ) => {
33- expect ( util . split ( "Hello world" , "," ) ) . toStrictEqual ( [ "Hello world" , "" ] )
34- } )
35- } )
36-
3727 describe ( "plural" , ( ) => {
3828 it ( "should add an s if count is greater than 1" , ( ) => {
3929 expect ( util . plural ( 2 , "dog" ) ) . toBe ( "dogs" )
@@ -57,43 +47,6 @@ describe("util", () => {
5747 } )
5848 } )
5949
60- describe ( "trimSlashes" , ( ) => {
61- it ( "should remove leading slashes" , ( ) => {
62- expect ( util . trimSlashes ( "/hello-world" ) ) . toBe ( "hello-world" )
63- } )
64-
65- it ( "should remove trailing slashes" , ( ) => {
66- expect ( util . trimSlashes ( "hello-world/" ) ) . toBe ( "hello-world" )
67- } )
68-
69- it ( "should remove both leading and trailing slashes" , ( ) => {
70- expect ( util . trimSlashes ( "/hello-world/" ) ) . toBe ( "hello-world" )
71- } )
72-
73- it ( "should remove multiple leading and trailing slashes" , ( ) => {
74- expect ( util . trimSlashes ( "///hello-world////" ) ) . toBe ( "hello-world" )
75- } )
76- } )
77-
78- describe ( "arrayify" , ( ) => {
79- it ( "should return value it's already an array" , ( ) => {
80- expect ( util . arrayify ( [ "hello" , "world" ] ) ) . toStrictEqual ( [ "hello" , "world" ] )
81- } )
82-
83- it ( "should wrap the value in an array if not an array" , ( ) => {
84- expect (
85- util . arrayify ( {
86- name : "Coder" ,
87- version : "3.8" ,
88- } ) ,
89- ) . toStrictEqual ( [ { name : "Coder" , version : "3.8" } ] )
90- } )
91-
92- it ( "should return an empty array if the value is undefined" , ( ) => {
93- expect ( util . arrayify ( undefined ) ) . toStrictEqual ( [ ] )
94- } )
95- } )
96-
9750 describe ( "logError" , ( ) => {
9851 beforeAll ( ( ) => {
9952 mockLogger ( )
0 commit comments