Skip to content

Commit e67a128

Browse files
committed
Create utilities.class.test.js
1 parent 4a13f44 commit e67a128

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

test/lib/utilites.class.test.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+

0 commit comments

Comments
 (0)