@locustjs/test 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +182 -103
- package/index.esm.js +272 -128
- package/package.json +1 -1
- package/tests/index.js +8 -13
package/package.json
CHANGED
package/tests/index.js
CHANGED
|
@@ -25,8 +25,8 @@ const tests = [
|
|
|
25
25
|
.toBeOfType("number");
|
|
26
26
|
|
|
27
27
|
expect(n)
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
.toBeValid((x) => x > 2)
|
|
29
|
+
.notToBeValid((x) => x < 2);
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
32
|
[
|
|
@@ -48,10 +48,7 @@ const tests = [
|
|
|
48
48
|
function (expect) {
|
|
49
49
|
const n = [];
|
|
50
50
|
|
|
51
|
-
expect(n)
|
|
52
|
-
.toBeDefined()
|
|
53
|
-
.toBeArray()
|
|
54
|
-
.toBeEmptyArray();
|
|
51
|
+
expect(n).toBeDefined().toBeArray().toBeEmptyArray();
|
|
55
52
|
},
|
|
56
53
|
],
|
|
57
54
|
[
|
|
@@ -59,10 +56,7 @@ const tests = [
|
|
|
59
56
|
function (expect) {
|
|
60
57
|
const n = [10];
|
|
61
58
|
|
|
62
|
-
expect(n)
|
|
63
|
-
.toBeDefined()
|
|
64
|
-
.toBeArray()
|
|
65
|
-
.toBeSomeArray();
|
|
59
|
+
expect(n).toBeDefined().toBeArray().toBeSomeArray();
|
|
66
60
|
},
|
|
67
61
|
],
|
|
68
62
|
[
|
|
@@ -82,7 +76,7 @@ const tests = [
|
|
|
82
76
|
[
|
|
83
77
|
"Test 6: object",
|
|
84
78
|
function (expect) {
|
|
85
|
-
const n = {a:10};
|
|
79
|
+
const n = { a: 10 };
|
|
86
80
|
|
|
87
81
|
expect(n)
|
|
88
82
|
.toBeDefined()
|
|
@@ -101,8 +95,9 @@ const tests = [
|
|
|
101
95
|
expect(x).toBeGreaterThan(20);
|
|
102
96
|
},
|
|
103
97
|
],
|
|
98
|
+
["Test 8: not expected", function (expect) {}],
|
|
104
99
|
[
|
|
105
|
-
"Test
|
|
100
|
+
"Test 9: class",
|
|
106
101
|
function (expect) {
|
|
107
102
|
const x = new Bar();
|
|
108
103
|
|
|
@@ -114,7 +109,7 @@ const tests = [
|
|
|
114
109
|
.toBeInstanceOf(Foo)
|
|
115
110
|
.notToBeInstanceOf(Buz);
|
|
116
111
|
},
|
|
117
|
-
]
|
|
112
|
+
],
|
|
118
113
|
];
|
|
119
114
|
|
|
120
115
|
TestRunner.start(tests);
|