risei 2.0.0 → 2.0.1
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 +114 -222
- package/package.json +1 -1
- package/Read-me reduced.md +0 -294
- package/Read-me redux.md +0 -581
- package/test-target-objects/ConditionalThrowTarget.js +0 -11
- package/test-target-objects/Counter.js +0 -46
- package/test-target-objects/DomTarget.js +0 -37
- package/test-target-objects/InterSpoofer.js +0 -230
- package/test-target-objects/MixedContents.js +0 -33
- package/test-target-objects/MutationTarget.js +0 -37
- package/test-target-objects/ObjectComposer.js +0 -34
- package/test-target-objects/PolySpoofableInner.js +0 -29
- package/test-target-objects/PolySpoofableOuter.js +0 -52
- package/test-target-objects/PropertiesTarget.js +0 -98
- package/test-target-objects/Returner.js +0 -7
- package/test-target-objects/Searcher.js +0 -25
- package/test-target-objects/Sorter.js +0 -91
- package/test-target-objects/Spoofable.js +0 -36
- package/test-target-objects/StateTarget.js +0 -34
- package/test-target-objects/StaticTarget.js +0 -17
- package/test-target-objects/TestableTarget.js +0 -57
- package/trial-tests/SelfTests.outward-rt.js +0 -511
- package/trial-tests/TopicTests.outward-rt.js +0 -313
- package/usage-examples/Gold-bar-example.png +0 -0
- package/usage-examples/Output-example.png +0 -0
- package/usage-examples/Summary-example.png +0 -0
- package/usage-examples/Syntax-example.png +0 -0
- package/usage-examples/Title-example.png +0 -0
- package/xternal-tests/ASpoofingFixture.tests.js +0 -242
- package/xternal-tests/MethodSpoofer.tests.js +0 -130
- package/xternal-tests/SpoofDef.tests.js +0 -91
- package/xternal-tests/TotalComparer.tests.js +0 -1055
- package/xternal-tests/package.json +0 -7
package/README.md
CHANGED
|
@@ -1,76 +1,73 @@
|
|
|
1
1
|
|
|
2
|
-
# Risei
|
|
2
|
+
# Risei Read-Me
|
|
3
3
|
|
|
4
|
-
##
|
|
4
|
+
## Overview
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
* Whip up full test coverage in no time for object-oriented (or object-hosted) JavaScript and TypeScript.
|
|
8
|
-
* Refactor or replace existing designs without worrying about about a heavy cost in past or future test construction.
|
|
9
|
-
* Create tests with immediate confidence, since you can't introduce mistakes when writing test code.
|
|
6
|
+
Risei is a new way to write unit tests that's easier and faster, more dependable, and keeps your tests from standing in the way of redesigns.
|
|
10
7
|
|
|
8
|
+
Risei does all this by replacing hand-coded tests with simple declarative syntax.
|
|
11
9
|
|
|
10
|
+
- Risei has many convenient and time-saving [features](#features-of-risei).
|
|
11
|
+
- Risei works with object-oriented JavaScript in modules.
|
|
12
|
+
- Risei works with TypeScript after just a few [tweaks](https://deusware.com/risei/index.html#typescript-with-risei).
|
|
12
13
|
|
|
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.
|
|
13
15
|
|
|
14
|
-
## The Risei approach
|
|
15
16
|
|
|
16
|
-
Risei replaces coded tests with simple declarative syntax.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
## Examples
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Here are two example tests, in which `SortModel.countSort()` is being tested using the inputs from `.in` and the expected output from `.out`:
|
|
21
21
|
|
|
22
|
+

|
|
22
23
|
|
|
23
|
-
Here is the terminal output of these two example tests. Tests are grouped by class and method. Inputs, expected, and actual values are displayed for all tests, to make intended usage obvious at a glance:
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Here are the example test results for those two tests:
|
|
26
26
|
|
|
27
|
+

|
|
27
28
|
|
|
29
|
+
- Outputs are always listed, even on passing tests, which makes code usage much clearer.
|
|
28
30
|
- Any failing tests appear in light red.
|
|
29
31
|
- Your latest tests always sort to the bottom so it's easy to find their results.
|
|
30
32
|
|
|
31
33
|
|
|
32
|
-
Test runs
|
|
34
|
+
Test runs have a title bar so the starting point is easy to find:
|
|
33
35
|
|
|
34
|
-

|
|
36
|
+

|
|
35
37
|
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
And they have a summary bar at the bottom:
|
|
38
40
|
|
|
39
|
-

|
|
41
|
+

|
|
40
42
|
|
|
43
|
+
- This bar is red when any tests fail, much as you'd expect.
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
|
|
44
|
-
##
|
|
47
|
+
## Status
|
|
45
48
|
|
|
46
|
-
Risei is under active development. The
|
|
49
|
+
Risei is under active development and new enhancements appear often. The latest release, **2.0.1**, brings many major improvements, including broader capabilities and simpler syntax, and a few minor breaking changes.
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
- You can now spoof properties on the targeted class instance.
|
|
50
|
-
- Risei now can determine automatically if tested or spoofed methods and properties are static.
|
|
51
|
-
- You can now perform arbitrary operations if needed.
|
|
52
|
-
- You can now change a test property without accidentally creating a new test.
|
|
53
|
-
- `Error` objects are now compared accurately.
|
|
54
|
-
- Outputs for `throw` tests are now the entire `Error` objects (breaking change).
|
|
51
|
+
Check out the [full list of changes](#version-history).
|
|
55
52
|
|
|
56
|
-
Risei has been reengineered internally along with these improvements.
|
|
57
53
|
|
|
58
|
-
- In addition, `ATestSource` is now a default export (breaking change).
|
|
59
|
-
- This means a simple adjustment from `import { ATestSource }` to `import ATestSource`.
|
|
60
54
|
|
|
61
|
-
|
|
55
|
+
## Features of Risei
|
|
62
56
|
|
|
63
|
-
&
|
|
64
|
-
[
|
|
57
|
+
- #### Declarative syntax to write tests simply and quickly. ► [Writing tests](https://deusware.com/risei/index.html#writing-tests) (basics below)
|
|
58
|
+
- #### Easy-to-read test definitions and test outputs. ► [Test and output examples](https://deusware.com/risei/index.html#examples) (also above)
|
|
59
|
+
- #### Even less to write by stating reused test properties only once. ► [Collapsing forward](https://deusware.com/risei/index.html#collapsing-forward) (basics below)
|
|
60
|
+
- #### Built-in declarative syntax to fake test-time values from dependencies. ► [Spoofing using `.plus`](https://deusware.com/risei/index.html#spoofing) (basics below)
|
|
61
|
+
- #### Testing properties, methods, static and instance members all the same way. ► [Properties and statics](https://deusware.com/risei/index.html#testing-properties-and-static-methods)
|
|
62
|
+
- #### Testing `throw` paths effortlessly. ► [Using `.and: "throws"`](https://deusware.com/risei/index.html#using-and-throws)
|
|
63
|
+
- #### Deriving actual values to test from raw outputs or property retrieval. ► [Using `.from`](https://deusware.com/risei/index.html#using-from)
|
|
64
|
+
- #### Setting up and tearing down arbitrary test state. ► [Using `.do` and `.undo`](https://deusware.com/risei/index.html#using-do-and-undo)
|
|
65
|
+
- #### Testing for `undefined` as output. ► [Using `this.undef`](https://deusware.com/risei/index.html#using-undef)
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
- And more! Check out the full [Risei home page](https://deusware.com/risei).
|
|
67
68
|
|
|
68
|
-
Risei works with Typescript, requiring only a few additional or different steps, described in [using Typescript with Risei](#using-typescript-with-risei).
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
### Installation
|
|
70
|
+
## Installation
|
|
74
71
|
|
|
75
72
|
Install Risei for development time only:
|
|
76
73
|
|
|
@@ -78,7 +75,7 @@ Install Risei for development time only:
|
|
|
78
75
|
npm install --save-dev risei
|
|
79
76
|
```
|
|
80
77
|
|
|
81
|
-
|
|
78
|
+
Ensure that `package.json` specifies ECMAScript modules:
|
|
82
79
|
|
|
83
80
|
```json
|
|
84
81
|
"type": "module"
|
|
@@ -92,26 +89,17 @@ And add Risei's metadata to `package.json`:
|
|
|
92
89
|
}
|
|
93
90
|
```
|
|
94
91
|
|
|
95
|
-
> Just a [few extra steps](#using-typescript-with-risei) are required for Risei to work with TypeScript.
|
|
96
|
-
|
|
97
|
-
&cruft, new site / section
|
|
98
|
-
- Further general options can be found [here](https://deusware.com/risei-docs/index.html#installation).
|
|
99
|
-
|
|
100
|
-
&cruft, new site / section
|
|
101
|
-
- Further Typescript details can be found [here](https://deusware.com/risei-docs/index.html#using-typescript).
|
|
102
92
|
|
|
103
93
|
|
|
94
|
+
## Running Tests
|
|
104
95
|
|
|
105
|
-
|
|
106
|
-
### Running tests
|
|
107
|
-
|
|
108
|
-
Once you've written your tests, run them by invoking Risei's `index.js` file:
|
|
96
|
+
Once you have some tests written, you can run them manually:
|
|
109
97
|
|
|
110
98
|
```bash
|
|
111
99
|
node ./node_modules/risei/index.js
|
|
112
100
|
```
|
|
113
101
|
|
|
114
|
-
Or write a `package.json`
|
|
102
|
+
Or write a script in `package.json` that does the same:
|
|
115
103
|
|
|
116
104
|
```json
|
|
117
105
|
"scripts": {
|
|
@@ -125,253 +113,158 @@ And then run that script:
|
|
|
125
113
|
npm test
|
|
126
114
|
```
|
|
127
115
|
|
|
128
|
-
- Risei can be used alongside other test frameworks, and even run with them from the same test script if you want.
|
|
129
|
-
|
|
130
|
-
&cruft, new site / section
|
|
131
|
-
- Find more information about this mixed testing and other config / run options [here](https://deusware.com/risei-docs/index.html#running-tests).
|
|
132
|
-
|
|
133
116
|
|
|
134
117
|
|
|
118
|
+
## Writing Tests
|
|
135
119
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
Add tests in files ending in `.rt.js` like this:
|
|
120
|
+
You write tests in `.rt.js` files like this:
|
|
139
121
|
|
|
140
122
|
```javascript
|
|
141
123
|
import ATestSource from "risei/ATestSource";
|
|
142
|
-
import
|
|
124
|
+
import ClassToTest from "ClassToTest.js";
|
|
143
125
|
|
|
144
126
|
export class SomeTests extends ATestSource {
|
|
145
|
-
tests = [ ... ];
|
|
127
|
+
tests = [ ... ];
|
|
146
128
|
}
|
|
147
129
|
```
|
|
148
130
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### Writing tests
|
|
152
|
-
|
|
153
|
-
Write tests with Risei's simple syntax:
|
|
131
|
+
Write individual tests as plain JavaScript objects with Risei's simple syntax:
|
|
154
132
|
|
|
155
133
|
```javascript
|
|
156
134
|
tests = [ ...
|
|
157
|
-
{ on:
|
|
158
|
-
of: "doesContain",
|
|
159
|
-
for: "When the arg is present, returns true.",
|
|
160
|
-
in: [ "c" ],
|
|
161
|
-
out: true },
|
|
162
|
-
...];
|
|
135
|
+
{ on: ContainerClass, with: [ "a", "b", "c" ], // Target class and constructor args.
|
|
136
|
+
of: "doesContain", // Target method name.
|
|
137
|
+
for: "When the arg is present, returns true.", // Description of test.
|
|
138
|
+
in: [ "c" ], // Inputs to method.
|
|
139
|
+
out: true }, // Expected output.
|
|
140
|
+
... ];
|
|
163
141
|
```
|
|
164
142
|
|
|
165
|
-
-
|
|
166
|
-
|
|
167
|
-
- To test a property of the target instance after running code, add a `.from` property with the property's name as a string.
|
|
168
|
-
|
|
169
|
-
- To test a value derived from the initial actual value, or otherwise from any available context, add a `from` property that's an arrow function taking (at present) `target` and `test` parameters: `(target, test) => { return test.actual.someProperty; }`.
|
|
170
|
-
|
|
171
|
-
- To perform operations like creating files temporarily, use the `.do` property (encompassing two stages, `.before` and `.after`) to set up isolated test state, and `.undo` to restore normal state.
|
|
172
|
-
- The `.do`-`.before` steps are taken before the target class instance is created, the `.do`-`.after steps are taken after that but before the target method / property is run.
|
|
173
|
-
- The `.undo` is an arrow function taking a `test` arg. It is run after all other steps of the test have been run. **(2.0.0)**
|
|
174
|
-
|
|
175
|
-
- To maintain the benefits of using Risei's declarative style, avoid arbitrary options as much as possible.
|
|
143
|
+
- Use empty arrays for `.in` or `.with` when there are no args to pass.
|
|
144
|
+
- You can use [long names](https://deusware.com/risei/index.html#long-names) for properties if you want.
|
|
176
145
|
|
|
177
|
-
- If you prefer test property names that aren't JavaScript keywords, alternatives are available for all of them.
|
|
178
146
|
|
|
179
|
-
- Further details about syntax options can be found [here](https://deusware.com/risei-docs/index.html#test-syntax).
|
|
180
147
|
|
|
148
|
+
## Basic collapsing forward example
|
|
181
149
|
|
|
150
|
+
You can state test properties once and let them _collapse forward_ across subsequent tests to save time and make tests easier to read.
|
|
182
151
|
|
|
183
|
-
|
|
184
|
-
#### Write more tests with less syntax:
|
|
185
|
-
|
|
186
|
-
To save a lot of time, state repeated test values just once, and let them _collapse forward_ into following tests:
|
|
152
|
+
Risei collapses values together from partial or full test objects until it has a full test to run. Every property collapses forward until it is changed or wiped out:
|
|
187
153
|
|
|
188
154
|
```javascript
|
|
189
|
-
|
|
190
|
-
{ on: ContainerModelClass, with: [ "a", "b", "c", "a", "b" ] },
|
|
191
|
-
|
|
192
|
-
/* Two tests for ContainerModelClass .doesContain(). */
|
|
193
|
-
{ of: "doesContain" },
|
|
194
|
-
{ for: "When the input arg is present, returns true.",
|
|
195
|
-
in: [ "c" ], out: true },
|
|
196
|
-
{ for: "When the input arg is not present, returns false.",
|
|
197
|
-
in: [ "d" ], out: false },
|
|
198
|
-
|
|
199
|
-
/* First test for ContainerModelClass .countOf(). */
|
|
200
|
-
{ of: "countOf", for: "Returns the number present.", in: [ "b" ], out: 2 }
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
- When you change the class in `.on`, all test properties are wiped away, and when you change the method in `.of`, only test properties about the class (like `.with`) are retained.
|
|
204
|
-
|
|
205
|
-
- Tests remain isolated, in effect, except when a test mutates input arguments. In that case, restate them in each test so the mutations aren't carried forward.
|
|
206
|
-
|
|
207
|
-
- Change test contents without possibly adding an unintended new test by adding a `.just` property (with any value, such as `true`) alongside the changed properties. **(2.0.0)**
|
|
208
|
-
|
|
209
|
-
&cruft, new site / details
|
|
210
|
-
- Further options and details can be found [here](https://deusware.com/risei-docs/index.html#collapsing-forward).
|
|
211
|
-
|
|
212
|
-
|
|
155
|
+
{ on: ContainerClass, with: [ "a", "b", "c" ] }, // Following tests are of this class.
|
|
213
156
|
|
|
157
|
+
{ of: "doesContain" }, // Following tests are of this method.
|
|
158
|
+
{ for: "Returns true when arg present.", in: [ "c" ], out: true }, // First test: now Risei has enough to run on.
|
|
159
|
+
{ for: "Returns false when arg absent.", in: [ "d" ], out: false }, // Next test: same method, different test case.
|
|
214
160
|
|
|
215
|
-
|
|
161
|
+
{ of: "countOf" }, // Change of tested method. Method-related props are wiped out.
|
|
162
|
+
...
|
|
216
163
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
```javascript
|
|
220
|
-
{ on: CombinerClass, with: [],
|
|
221
|
-
of: "combineResults",
|
|
222
|
-
plus: [
|
|
223
|
-
{ on: ClassA, of: "someMethod", as: 10 }, // Spoofing one method to return 10.
|
|
224
|
-
{ on: ClassB, of: "someMethod" }, // Spoofing one method not to return anything.
|
|
225
|
-
{ on: ClassC, as: [ // Spoofing two class methods together.
|
|
226
|
-
{ of: "firstMethod", as: 11 },
|
|
227
|
-
{ of: "secondMethod", as: 12 }
|
|
228
|
-
] },
|
|
229
|
-
],
|
|
230
|
-
for: "When called, returns an array of values from sources.",
|
|
231
|
-
in: [ "green" ], out: [ 7, 8, 9, 10, 10, 11, 12, { color: "green" } ] }
|
|
164
|
+
{ on: SortingClass, with: [ ] }, // Change of tested class. All existing props are wiped out.
|
|
232
165
|
```
|
|
233
166
|
|
|
234
|
-
-
|
|
235
|
-
|
|
236
|
-
&cruft, site / section
|
|
237
|
-
- There are many further spoofing options that save effort, including using nonce methods as spoofs and spoofing target-instance properties. **(2.0.0)** Check out all your options [here](https://deusware.com/risei-docs/index.html#collapsing-forward).
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
- Spoofed code is fully isolated within tests, even though spoof definitions collapse forward across tests (and within `.plus`).
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
167
|
+
- There are more options available, and an exclusion for mutated args.
|
|
168
|
+
- Learn all the details [here](https://deusware.com/risei/index.html#collapsing-forward).
|
|
244
169
|
|
|
245
|
-
## Using TypeScript with Risei
|
|
246
170
|
|
|
247
|
-
Testing TypeScript code with Risei basically just means transpiling before running the tests, and pointing Risei to the transpiled JS files.
|
|
248
171
|
|
|
249
|
-
|
|
172
|
+
## Basic spoofing example
|
|
250
173
|
|
|
251
|
-
|
|
252
|
-
- These steps have worked with both Angular and React.
|
|
253
|
-
- Varying other approaches are also sure to work, depending on the other technical choices in play.
|
|
174
|
+
You can use declarative _spoofing_ syntax to define what dependencies of your targeted code return for it to use.
|
|
254
175
|
|
|
176
|
+
The most basic spoofing looks like this:
|
|
255
177
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
"
|
|
263
|
-
|
|
178
|
+
```javascript
|
|
179
|
+
{
|
|
180
|
+
on: TestedClass,
|
|
181
|
+
...
|
|
182
|
+
plus: [
|
|
183
|
+
{ on: Dependency, of: "someMethod", as: 10 }, // Dependency.someMethod() returns 10 in this test.
|
|
184
|
+
{ of: "testedClassMethod", as: 11 } // TestedClass.testedClassMethod() returns 11 in this test.
|
|
185
|
+
],
|
|
186
|
+
...
|
|
264
187
|
}
|
|
265
188
|
```
|
|
266
189
|
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
- The deletion path must match the `outDir` in `tsconfig.json`.
|
|
190
|
+
- Numerous additional capabilities, as well as compressed syntax, can be mixed freely in many ways.
|
|
191
|
+
- Learn more [here](https://deusware.com/risei/index.html#spoofing).
|
|
270
192
|
|
|
271
|
-
> You can run Risei manually with the same sequence of operations.
|
|
272
193
|
|
|
273
194
|
|
|
195
|
+
## TypeScript with Risei
|
|
274
196
|
|
|
275
|
-
|
|
197
|
+
To test TypeScript code with Risei, you make sure the code is transpiled before the tests are run, and you point Risei to the transpiled `.js` files.
|
|
276
198
|
|
|
277
|
-
|
|
199
|
+
- Learn all about it [here](https://deusware.com/risei/index.html#typescript-with-risei).
|
|
278
200
|
|
|
279
|
-
```json
|
|
280
|
-
{
|
|
281
|
-
"outDir": "dist/out-tsc",
|
|
282
|
-
"noEmit": false
|
|
283
|
-
}
|
|
284
|
-
```
|
|
285
201
|
|
|
286
|
-
- The `outDir` can be any location. It's best not to just use `dist`, where adding or deleting files may interfere with web frameworks' build steps.
|
|
287
|
-
- These settings are normally not near each other in the file (as seen here).
|
|
288
|
-
- You can also set the `target` to `es6` or higher, although Risei works fine with ES5.
|
|
289
202
|
|
|
203
|
+
## Troubleshooting
|
|
290
204
|
|
|
205
|
+
If problems cause test files not to load, a gold bar appears and tests in those files disappear from output:
|
|
291
206
|
|
|
292
|
-
|
|
207
|
+

|
|
293
208
|
|
|
294
|
-
|
|
209
|
+
- Those and other problems can be solved with the help of this [troubleshooting guide](https://deusware.com/risei/index.html#troubleshooting).
|
|
295
210
|
|
|
296
|
-
```javascript
|
|
297
|
-
import { TestedClass } from "../../dist/out-tsc/SubPath/TestedClass.js";
|
|
298
|
-
```
|
|
299
211
|
|
|
300
|
-
|
|
212
|
+
## Version history
|
|
301
213
|
|
|
214
|
+
- Release **2.0.1** (August, 2024) contains all of these changes:
|
|
215
|
+
- Risei now can determine automatically if tested methods are static.
|
|
216
|
+
- You can now directly test properties just like methods.
|
|
217
|
+
- Risei can also determine automatically if these are static.
|
|
218
|
+
- Directly tested properties appear in the output in the form `.name`.
|
|
219
|
+
- You can now spoof properties on the targeted class instance, and static properties on the target class itself.
|
|
220
|
+
- You can now perform arbitrary operations, if needed, with the two-part `.do` property and one-part `.undo` property.
|
|
221
|
+
- You can now change test properties without accidentally creating a new test using `.just`.
|
|
222
|
+
- You can now directly test for `undefined` in `.out` using `this.undef` / `ATestSource.undefSymbol`.
|
|
223
|
+
- `Error` objects are now compared accurately.
|
|
224
|
+
- You can now identify member types with `.`, `:`, and `()` in `.of`, `.plus`, and `.from`, though they aren't necessary.
|
|
225
|
+
- **(Breaking change)** The actual for throw tests is now the entire thrown object (usually an `Error`), rather than the `Error`'s message text.
|
|
226
|
+
- **(Breaking change)** `ATestSource` is now a default export, changing its imports from `import { ATestSource } from` to `import ATestSource from`.
|
|
302
227
|
|
|
228
|
+
> Risei has been massively re-engineered internally along with these improvements.
|
|
303
229
|
|
|
304
230
|
|
|
305
|
-
## What's new in Risei
|
|
306
231
|
|
|
307
|
-
|
|
232
|
+
<details>
|
|
233
|
+
<summary>
|
|
234
|
+
Older releases
|
|
235
|
+
</summary>
|
|
308
236
|
|
|
237
|
+
- Release **2.0.0** (August, 2024) is identical to 2.0.1 except for some unneeded extra files.
|
|
309
238
|
- Release **1.3.4** (March, 2024) fixed a bug that caused class display problems in some cases.
|
|
310
|
-
|
|
311
239
|
- Release **1.3.3** (March, 2024) fixed a major bug that prevented tests from running in Windows.
|
|
312
|
-
|
|
313
240
|
- Release **1.3.2** (February, 2024) only improved this read-me's contents.
|
|
314
|
-
|
|
315
241
|
- Release **1.3.1** (February, 2024) reversed some changes in 1.3.0 that did not work as hoped.
|
|
316
|
-
|
|
317
242
|
- Release **1.3.0** (February, 2024) added the loading-error gold bar and fixed a test-sorting bug.
|
|
318
|
-
|
|
319
243
|
- Release **1.2.0** (January, 2024) changed test sorting to move last-edited tests to the end.
|
|
320
|
-
|
|
321
244
|
- Release **1.1.2** of Risei (January, 2024) fixed class displays and inaccurate `Date` comparisons.
|
|
322
245
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
## Troubleshooting
|
|
329
|
-
|
|
330
|
-
Problems loading tests are almost always a missing or extra comma, brace, or similar. When a test file can't be loaded, loading continues with the next file. The number of tests drops (or doesn't increase as expected), and a gold bar appears naming the file and problem:
|
|
331
|
-
|
|
332
|
-

|
|
333
|
-
|
|
334
|
-
- Unfortunately, there is no way to list the problem line number.
|
|
335
|
-
- A sudden fail of many test files is usually due to a problem in the tested code, not the tests themselves.
|
|
336
|
-
|
|
337
|
-
Problems with test results themselves are usually due to omissions or other mistakes in test definitions.
|
|
338
|
-
|
|
339
|
-
For far more information about troubleshooting, including some specific error messages, check out the documentation [here](https://deusware.com/risei-docs/index.html#troubleshooting).
|
|
340
|
-
|
|
246
|
+
> The oldest releases are no longer listed here, and old releases are dropped progressively over time. Using the latest release is recommended.
|
|
341
247
|
|
|
248
|
+
</details>
|
|
342
249
|
|
|
343
250
|
|
|
344
251
|
## Known issues and workarounds
|
|
345
252
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
- When tested code mutates its args, the mutated forms are used in subsequent tests if collapsed forward.
|
|
349
|
-
- To avoid this, simply restate the args for each test that mutates them.
|
|
253
|
+
The only issue at present is reuse of method args mutated by tested code when collapsing forward.
|
|
350
254
|
|
|
255
|
+
- The workaround is just to restate those args for each test.
|
|
351
256
|
|
|
352
|
-
- When a few properties are changed in separate objects, they are treated as whole new tests, which usually fail because of their unintended mix of old and new properties.
|
|
353
|
-
- To avoid this problem, just add a `.just` or `.only` property, of any value, in the same objects as those tests.change properties as part of whole new tests, or else restate `.of` along with the changed properties.
|
|
354
|
-
- You can also clear existing properties with `.on` or `.of` and then do this, since then there aren't enough test properties present yet to comprise a full test.
|
|
355
257
|
|
|
258
|
+
## Exclusions from Risei
|
|
356
259
|
|
|
260
|
+
At present, there are a few things Risei doesn't support, such as `async` syntax. Some of these may be supported in the future.
|
|
357
261
|
|
|
358
|
-
|
|
262
|
+
- You can see the whole list [here](https://deusware.com/risei/index.html#exclusions-from-risei).
|
|
263
|
+
- You can save a lot of time by using Risei for most of your code, and another framework for whatever it doesn't support.
|
|
359
264
|
|
|
360
|
-
The following are not supported at present:
|
|
361
|
-
- Use of `async` syntax
|
|
362
|
-
- Code written in ESM `export` modules, but not within classes
|
|
363
|
-
- Standalone functions and other functionality not built into classes, AKA _loose code_
|
|
364
|
-
- CJS syntax using `require()`
|
|
365
|
-
- Debugging model code during tests
|
|
366
|
-
- Comparing rare JS object types like `Proxy` or `ArrayBuffer` in test assertions
|
|
367
265
|
|
|
368
|
-
Some of these are on the tentative future-development list.
|
|
369
|
-
- In the meantime, Risei can be used to save development time for most of your JavaScript code, while these cases can be tested using another framework invoked alongside Risei.
|
|
370
266
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
## Who makes Risei
|
|
267
|
+
## Maker
|
|
375
268
|
|
|
376
269
|
Risei is written by myself, Ed Fallin. I'm a longtime software developer who likes to find better ways to do things.
|
|
377
270
|
|
|
@@ -381,8 +274,7 @@ You can get in touch about Risei at **riseimaker@gmail.com**.
|
|
|
381
274
|
|
|
382
275
|
|
|
383
276
|
|
|
384
|
-
|
|
385
|
-
## Risei license
|
|
277
|
+
## License
|
|
386
278
|
|
|
387
279
|
Risei is published for use under the terms of the MIT license:
|
|
388
280
|
|