@locustjs/test 1.3.1 → 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 +346 -231
- package/index.esm.js +1471 -842
- package/package.json +2 -2
- package/tests/index.js +19 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locustjs/test",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "This library provides a simple test runner.",
|
|
5
5
|
"main": "index.cjs.js",
|
|
6
6
|
"module": "index.esm.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/ironcodev/locustjs-test#readme",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@locustjs/base": "^
|
|
26
|
+
"@locustjs/base": "^4.0.0",
|
|
27
27
|
"@locustjs/exception": "^2.0.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
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,14 +56,11 @@ 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
|
[
|
|
69
|
-
"Test
|
|
63
|
+
"Test 5: empty object",
|
|
70
64
|
function (expect) {
|
|
71
65
|
const n = {};
|
|
72
66
|
|
|
@@ -80,9 +74,9 @@ const tests = [
|
|
|
80
74
|
},
|
|
81
75
|
],
|
|
82
76
|
[
|
|
83
|
-
"Test
|
|
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()
|
|
@@ -94,7 +88,16 @@ const tests = [
|
|
|
94
88
|
},
|
|
95
89
|
],
|
|
96
90
|
[
|
|
97
|
-
"Test
|
|
91
|
+
"Test 7: error",
|
|
92
|
+
function (expect) {
|
|
93
|
+
const x = 10;
|
|
94
|
+
|
|
95
|
+
expect(x).toBeGreaterThan(20);
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
["Test 8: not expected", function (expect) {}],
|
|
99
|
+
[
|
|
100
|
+
"Test 9: class",
|
|
98
101
|
function (expect) {
|
|
99
102
|
const x = new Bar();
|
|
100
103
|
|
|
@@ -106,11 +109,7 @@ const tests = [
|
|
|
106
109
|
.toBeInstanceOf(Foo)
|
|
107
110
|
.notToBeInstanceOf(Buz);
|
|
108
111
|
},
|
|
109
|
-
]
|
|
112
|
+
],
|
|
110
113
|
];
|
|
111
114
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
runner.run(tests).then((result) => {
|
|
115
|
-
runner.report(result.failed > 0);
|
|
116
|
-
});
|
|
115
|
+
TestRunner.start(tests);
|