File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ import Utility from "../../src/lib/utilities.class.js"
2
+
3
+ test ( 'isEmpty of an empty Array' , ( ) => {
4
+ expect (
5
+ Utility . isEmpty ( [ ] )
6
+ ) . toBe ( true ) ;
7
+ } ) ;
8
+
9
+ test ( 'isEmpty of not an empty Array' , ( ) => {
10
+ expect (
11
+ Utility . isEmpty ( [ "ada" ] )
12
+ ) . toBe ( false ) ;
13
+ } ) ;
14
+
15
+ test ( 'isEmpty of an empty Object' , ( ) => {
16
+ expect (
17
+ Utility . isEmpty ( { } )
18
+ ) . toBe ( true ) ;
19
+ } ) ;
20
+
21
+ test ( 'isEmpty of not an empty Object' , ( ) => {
22
+ expect (
23
+ Utility . isEmpty ( { options : "ada" } )
24
+ ) . toBe ( false ) ;
25
+ } ) ;
26
+
27
+ // Reverse of isEmpty
28
+ test ( 'Not isEmpty of an empty Array' , ( ) => {
29
+ expect (
30
+ ! Utility . isEmpty ( [ ] )
31
+ ) . toBe ( false ) ;
32
+ } ) ;
33
+
34
+ test ( 'Not isEmpty of not an empty Array' , ( ) => {
35
+ expect (
36
+ ! Utility . isEmpty ( [ "ada" ] )
37
+ ) . toBe ( true ) ;
38
+ } ) ;
39
+
40
+ test ( 'Not isEmpty of an empty Object' , ( ) => {
41
+ expect (
42
+ ! Utility . isEmpty ( { } )
43
+ ) . toBe ( false ) ;
44
+ } ) ;
45
+
46
+ test ( 'Not isEmpty of not an empty Object' , ( ) => {
47
+ expect (
48
+ ! Utility . isEmpty ( { options : "ada" } )
49
+ ) . toBe ( true ) ;
50
+ } ) ;
51
+
You can’t perform that action at this time.
0 commit comments