File tree Expand file tree Collapse file tree 2 files changed +39
-4
lines changed Expand file tree Collapse file tree 2 files changed +39
-4
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @jest -environment node
3
+ */
4
+
5
+ import { console } from "@/util/helper" ;
6
+
7
+ describe ( "console" , ( ) => {
8
+ test . each ( [
9
+ [ "log" ] ,
10
+ [ "warn" ] ,
11
+ [ "error" ] ,
12
+ [ "info" ] ,
13
+ ] ) (
14
+ "has %s function" ,
15
+ ( key ) => {
16
+ const actual = console [ key ] ;
17
+ expect ( typeof actual ) . toEqual ( "function" ) ;
18
+ }
19
+ )
20
+ } ) ;
Original file line number Diff line number Diff line change 1
- import { camelize } from "@/util/helper" ;
2
-
1
+ import { camelize , console } from "@/util/helper" ;
3
2
4
3
describe ( "camelize" , ( ) => {
5
4
test . each ( [
6
5
[ "MyProp" , "MyProp" ] ,
7
6
[ "MyProp" , "MyProp" ] ,
8
7
[ "kebab-case" , "kebabCase" ] ,
9
8
[ "multi-hyphen-string" , "multiHyphenString" ] ,
10
- [ "drag-class" , "dragClass" ]
9
+ [ "drag-class" , "dragClass" ] ,
10
+ [ "test-" , "test-" ]
11
11
] ) (
12
- "transfoem %s into %s" ,
12
+ "transform %s into %s" ,
13
13
( value , expected ) => {
14
14
const actual = camelize ( value ) ;
15
15
expect ( actual ) . toEqual ( expected ) ;
16
16
}
17
17
)
18
+ } ) ;
19
+
20
+ describe ( "console" , ( ) => {
21
+ test . each ( [
22
+ [ "log" ] ,
23
+ [ "warn" ] ,
24
+ [ "error" ] ,
25
+ [ "info" ] ,
26
+ ] ) (
27
+ "has %s function" ,
28
+ ( key ) => {
29
+ const actual = console [ key ] ;
30
+ expect ( typeof actual ) . toEqual ( "function" ) ;
31
+ }
32
+ )
18
33
} ) ;
You can’t perform that action at this time.
0 commit comments