risei 3.3.1 → 3.3.2
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/README.md +11 -4
- package/package.json +6 -2
- package/system/PropertySpoofer.js +1 -1
- package/system/SpoofDef.js +6 -18
- package/system/TestDef.js +341 -387
- package/system/TestFinder.js +1 -1
- package/system/TestFrame.js +20 -9
- package/system/TestRunner.js +12 -36
- package/system/TestStages.js +69 -172
- package/system/TestSummary.js +6 -18
- package/system/TestTargets.js +114 -0
- package/system/TotalComparer.js +0 -2
- package/system/TypeAnalyzer.js +0 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Risei is a new way to write unit tests that's easier and faster, more dependable
|
|
|
8
8
|
Risei does all this by replacing hand-coded tests with simple declarative syntax.
|
|
9
9
|
|
|
10
10
|
- Risei has many convenient and time-saving [features](#features-of-risei).
|
|
11
|
-
- Risei works with
|
|
11
|
+
- Risei works with class-based JavaScript in modules.
|
|
12
12
|
- Risei works with TypeScript after just a few [tweaks](https://deusware.com/risei/index.html#typescript-with-risei).
|
|
13
13
|
|
|
14
14
|
You can find a longer version of this read-me at [https://deusware.com/risei](https://deusware.com/risei/index.html). It expands greatly on the information here.
|
|
@@ -46,7 +46,8 @@ And they have a summary bar at the bottom:
|
|
|
46
46
|
|
|
47
47
|
## Status
|
|
48
48
|
|
|
49
|
-
Risei's major features are now complete, but new enhancements or fixes may appear from time to time
|
|
49
|
+
Risei's major features are now complete, but new enhancements or fixes may appear from time to time. \
|
|
50
|
+
The latest release, **3.3.2**, adds `async` capabilities formerly missing from the `.from` feature.
|
|
50
51
|
|
|
51
52
|
Check out the [full list of changes](#version-history).
|
|
52
53
|
|
|
@@ -121,7 +122,8 @@ tests = [ ...
|
|
|
121
122
|
... ];
|
|
122
123
|
```
|
|
123
124
|
|
|
124
|
-
- Asynchronous
|
|
125
|
+
- **Asynchronous / awaitable code can tested with no changes at all to this syntax.**
|
|
126
|
+
- And you use `async` and `await` normally if you define functions within tests.
|
|
125
127
|
- Use empty arrays for `.in` or `.with` when there are no args to pass.
|
|
126
128
|
- You can use [long names](https://deusware.com/risei/index.html#long-names) for properties if you want.
|
|
127
129
|
|
|
@@ -218,6 +220,11 @@ If errors are thrown while testing, gold bars listing them appear at the bottom,
|
|
|
218
220
|
|
|
219
221
|
## Version history
|
|
220
222
|
|
|
223
|
+
- Release **3.3.2** (September, 2025) contains this change:
|
|
224
|
+
- You can now use asynchronous / awaitable code in `.from` using `async` and `await` normally.
|
|
225
|
+
- You already could use awaitable code with the normal syntax in `.plus`, `.do`, and `.undo`.
|
|
226
|
+
|
|
227
|
+
|
|
221
228
|
- Release **3.3.1** (February, 2025) contains this change:
|
|
222
229
|
- You can now spoof and otherwise address value properties (formally _data descriptors_) that don't have an initial value, whether they are static or instance class members.
|
|
223
230
|
|
|
@@ -285,7 +292,7 @@ At present, there are a few things Risei doesn't support. Some of these m
|
|
|
285
292
|
- You can see the whole list [here](https://deusware.com/risei/index.html#exclusions-from-risei).
|
|
286
293
|
|
|
287
294
|
|
|
288
|
-
|
|
295
|
+
You can save a lot of time by using Risei for most of your code, but another framework for whatever it doesn't support.
|
|
289
296
|
|
|
290
297
|
|
|
291
298
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "risei",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Risei allows you to write unit tests as simple JavaScript objects, so it's easy and fast, with no drag on redesign.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unit test",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"objects",
|
|
16
16
|
"declarative",
|
|
17
17
|
"javascript",
|
|
18
|
+
"class",
|
|
19
|
+
"modules",
|
|
20
|
+
"object-oriented",
|
|
21
|
+
"object oriented",
|
|
18
22
|
"typescript"
|
|
19
23
|
],
|
|
20
24
|
"author": "Ed Fallin <riseimaker@gmail.com>",
|
|
@@ -50,6 +54,6 @@
|
|
|
50
54
|
"fs": "^0.0.1-security",
|
|
51
55
|
"mocha": "^10.0.0",
|
|
52
56
|
"morgan": "~1.9.1",
|
|
53
|
-
"risei": "^3.3.
|
|
57
|
+
"risei": "^3.3.1"
|
|
54
58
|
}
|
|
55
59
|
}
|
|
@@ -78,7 +78,7 @@ export default class PropertySpoofer extends ASpoofingFixture {
|
|
|
78
78
|
// Stripping spoofs of any sigils.
|
|
79
79
|
propertySpoofs.forEach(x => x.method = NameAnalyzer.plainNameOf(x.method));
|
|
80
80
|
|
|
81
|
-
// Storing
|
|
81
|
+
// Storing spoofing definitions.
|
|
82
82
|
this.#settables = propertySpoofs;
|
|
83
83
|
|
|
84
84
|
// Storing original values for restoring later.
|
package/system/SpoofDef.js
CHANGED
|
@@ -42,29 +42,17 @@ export default class SpoofDef {
|
|
|
42
42
|
|
|
43
43
|
/* These short names make JSON-like definitions easier. */
|
|
44
44
|
|
|
45
|
-
get on() {
|
|
46
|
-
return this.target;
|
|
47
|
-
}
|
|
45
|
+
get on() { return this.target; }
|
|
48
46
|
|
|
49
|
-
set on(value) {
|
|
50
|
-
this.target = value;
|
|
51
|
-
}
|
|
47
|
+
set on(value) { this.target = value; }
|
|
52
48
|
|
|
53
|
-
get of() {
|
|
54
|
-
return this.method;
|
|
55
|
-
}
|
|
49
|
+
get of() { return this.method; }
|
|
56
50
|
|
|
57
|
-
set of(value) {
|
|
58
|
-
this.method = value;
|
|
59
|
-
}
|
|
51
|
+
set of(value) { this.method = value; }
|
|
60
52
|
|
|
61
|
-
get as() {
|
|
62
|
-
return this.output;
|
|
63
|
-
}
|
|
53
|
+
get as() { return this.output; }
|
|
64
54
|
|
|
65
|
-
set as(value) {
|
|
66
|
-
this.output = value;
|
|
67
|
-
}
|
|
55
|
+
set as(value) { this.output = value; }
|
|
68
56
|
|
|
69
57
|
// endregion Spoof definition, short names
|
|
70
58
|
|