risei 1.1.0 → 1.1.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 +195 -338
- package/index.js +9 -9
- package/package.json +7 -7
- package/{public/javascript → system}/ChosenTestFinder.js +2 -2
- package/{public/javascript → system}/SpoofClassMethodsFixture.js +38 -22
- package/system/SpoofObjectMethodsFixture.js +58 -0
- package/{public/javascript → system}/SpoofTuple.js +14 -0
- package/system/TestFrame.js +187 -0
- package/{public/javascript → system}/TestFrameChooser.js +6 -47
- package/{public/javascript → system}/TestFrames.js +232 -180
- package/system/TestResult.js +187 -0
- package/system/TestStages.js +278 -0
- package/{public/javascript → system}/TestTuple.js +126 -18
- package/{public/javascript → system}/TotalComparer.js +12 -0
- package/system/TotalCopier.js +79 -0
- package/system/TotalDisplayer.js +143 -0
- package/system/TypeAnalyzer.js +103 -0
- package/system/TypeIdentifier.js +70 -0
- package/system/Types.js +17 -0
- package/public/javascript/SpoofObjectMethodsFixture.js +0 -52
- package/public/javascript/TestResult.js +0 -338
- /package/{public/javascript → system}/AComparer.js +0 -0
- /package/{public/javascript → system}/ASpoofingFixture.js +0 -0
- /package/{public/javascript → system}/ATestCaller.js +0 -0
- /package/{public/javascript → system}/ATestFinder.js +0 -0
- /package/{public/javascript → system}/ATestFixture.js +0 -0
- /package/{public/javascript → system}/ATestReporter.js +0 -0
- /package/{public/javascript → system}/ATestSource.js +0 -0
- /package/{public/javascript → system}/ClassTestGroup.js +0 -0
- /package/{public/javascript → system}/LocalCaller.js +0 -0
- /package/{public/javascript → system}/MethodTestGroup.js +0 -0
- /package/{public/javascript → system}/Moment.js +0 -0
- /package/{public/javascript → system}/Risei.js +0 -0
- /package/{public/javascript → system}/TerminalReporter.js +0 -0
- /package/{public/javascript → system}/TestFinder.js +0 -0
- /package/{public/javascript → system}/TestGroup.js +0 -0
- /package/{public/javascript → system}/TestRunner.js +0 -0
- /package/{public/javascript → system}/TestSummary.js +0 -0
|
@@ -1,180 +1,232 @@
|
|
|
1
|
-
/**/
|
|
2
|
-
|
|
3
|
-
import { AComparer } from "./AComparer.js";
|
|
4
|
-
import { TotalComparer } from "./TotalComparer.js";
|
|
5
|
-
|
|
6
|
-
export class TestFrames {
|
|
7
|
-
/* &cruft : refactor to merge with same on TestFrameChooser */
|
|
8
|
-
// Used for special test cases.
|
|
9
|
-
constructorName = "constructor";
|
|
10
|
-
staticName = "static";
|
|
11
|
-
|
|
12
|
-
/* &cruft : probably refactor comparing usage */
|
|
13
|
-
/* Each test frame is bound to the calling instance of TestRunner,
|
|
14
|
-
for now at least. TestRunner includes #compare() for now. */
|
|
15
|
-
|
|
16
|
-
#comparer;
|
|
17
|
-
|
|
18
|
-
constructor() {
|
|
19
|
-
// Comparer is inited once for all tests, since compare() is reentrant.
|
|
20
|
-
this.#comparer = new TotalComparer();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// The most basic test: whether a call of
|
|
24
|
-
// a method returns the expected value.
|
|
25
|
-
testReturnValueOfCall(test) {
|
|
26
|
-
/* Groundwork. */
|
|
27
|
-
let prototype = test.on.prototype;
|
|
28
|
-
let target = new prototype.constructor(...test.with); // Must use `...`.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/*
|
|
63
|
-
test.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/*
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
/*
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
1
|
+
/**/
|
|
2
|
+
|
|
3
|
+
import { AComparer } from "./AComparer.js";
|
|
4
|
+
import { TotalComparer } from "./TotalComparer.js";
|
|
5
|
+
|
|
6
|
+
export class TestFrames {
|
|
7
|
+
/* &cruft : refactor to merge with same on TestFrameChooser */
|
|
8
|
+
// Used for special test cases.
|
|
9
|
+
constructorName = "constructor";
|
|
10
|
+
staticName = "static";
|
|
11
|
+
|
|
12
|
+
/* &cruft : probably refactor comparing usage */
|
|
13
|
+
/* Each test frame is bound to the calling instance of TestRunner,
|
|
14
|
+
for now at least. TestRunner includes #compare() for now. */
|
|
15
|
+
|
|
16
|
+
#comparer;
|
|
17
|
+
|
|
18
|
+
constructor() {
|
|
19
|
+
// Comparer is inited once for all tests, since compare() is reentrant.
|
|
20
|
+
this.#comparer = new TotalComparer();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// The most basic test: whether a call of
|
|
24
|
+
// a method returns the expected value.
|
|
25
|
+
testReturnValueOfCall(test) {
|
|
26
|
+
/* Groundwork. */
|
|
27
|
+
let prototype = test.on.prototype;
|
|
28
|
+
let target = new prototype.constructor(...test.with); // Must use `...`.
|
|
29
|
+
|
|
30
|
+
this.#anyPropertySetting(target, test.settables);
|
|
31
|
+
|
|
32
|
+
/* Exercising the code. */
|
|
33
|
+
test.actual = target[test.of](...test.in); // Must use `...`.
|
|
34
|
+
|
|
35
|
+
/* Comparing. */
|
|
36
|
+
test.didPass = this.#compare(test.out, test.actual);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
testReturnValueOfStaticCall(test) {
|
|
40
|
+
/* Groundwork. */
|
|
41
|
+
/* No instance is constructed. */
|
|
42
|
+
|
|
43
|
+
let unsettables = this.#anyOriginalPropertyGetting(test.type, test.settables);
|
|
44
|
+
this.#anyPropertySetting(test.type, test.settables);
|
|
45
|
+
|
|
46
|
+
/* Exercising the code. */
|
|
47
|
+
test.actual = test.on[test.of](...test.in); // Must use `...`.
|
|
48
|
+
|
|
49
|
+
this.#anyPropertyUnsetting(test.type, unsettables);
|
|
50
|
+
|
|
51
|
+
/* Comparing. */
|
|
52
|
+
test.didPass = this.#compare(test.out, test.actual);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// The second-most basic test: whether a property
|
|
56
|
+
// has the expected value after a method call.
|
|
57
|
+
testCodeElementAfterCall(test) {
|
|
58
|
+
/* Groundwork. */
|
|
59
|
+
let prototype = test.on.prototype;
|
|
60
|
+
let target = new prototype.constructor(...test.with); // Must use `...`.
|
|
61
|
+
|
|
62
|
+
/* Exercising the code. */
|
|
63
|
+
target[test.of](...test.in); // Must use `...`.
|
|
64
|
+
|
|
65
|
+
/* Retrieving. */
|
|
66
|
+
// The `actual` is a property or other code element somewhere.
|
|
67
|
+
test.actual = this.#supplyNonReturnActual(test, target);
|
|
68
|
+
|
|
69
|
+
/* Comparing. */
|
|
70
|
+
test.didPass = this.#compare(test.out, test.actual);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
testCodeElementAfterStaticCall(test) {
|
|
74
|
+
/* Groundwork. */
|
|
75
|
+
/* No instance is constructed. */
|
|
76
|
+
|
|
77
|
+
/* Exercising the code. */
|
|
78
|
+
test.on[test.of](...test.in); // Must use `...`.
|
|
79
|
+
|
|
80
|
+
/* Retrieving. */
|
|
81
|
+
test.actual = this.#supplyNonReturnActual(test); // No `target` here.
|
|
82
|
+
|
|
83
|
+
/* Comparing. */
|
|
84
|
+
test.didPass = this.#compare(test.out, test.actual);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// The third-most basic test: whether a property has
|
|
88
|
+
// the expected value after an object is constructed.
|
|
89
|
+
testCodeElementAfterConstruction(test) {
|
|
90
|
+
/* Groundwork. */
|
|
91
|
+
// For definition consistency, initing with test.in, not test.with.
|
|
92
|
+
let prototype = test.on.prototype;
|
|
93
|
+
|
|
94
|
+
/* Exercising the code. */
|
|
95
|
+
let target = new prototype.constructor(...test.in); // Must use `...`.
|
|
96
|
+
|
|
97
|
+
/* Retrieving. */
|
|
98
|
+
// The `actual` is a property or other code element somewhere.
|
|
99
|
+
test.actual = this.#supplyNonReturnActual(test, target);
|
|
100
|
+
|
|
101
|
+
/* Comparing. */
|
|
102
|
+
test.didPass = this.#compare(test.out, test.actual);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
testThrowResultAfterCall(test) {
|
|
106
|
+
/* Groundwork. */
|
|
107
|
+
let prototype = test.on.prototype;
|
|
108
|
+
let target = new prototype.constructor(...test.with); // Must use `...`.
|
|
109
|
+
|
|
110
|
+
/* Exercising the code. */
|
|
111
|
+
try {
|
|
112
|
+
target[test.of](...test.in); // Must use `...`.
|
|
113
|
+
}
|
|
114
|
+
/* Retrieving. */
|
|
115
|
+
catch (thrown) {
|
|
116
|
+
test.actual = thrown.message;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Comparing. */
|
|
120
|
+
test.didPass = this.#compare(test.out, test.actual);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
testThrowResultAfterStaticCall(test) {
|
|
124
|
+
/* Groundwork. */
|
|
125
|
+
/* No instance is constructed. */
|
|
126
|
+
|
|
127
|
+
/* Exercising the code. */
|
|
128
|
+
try {
|
|
129
|
+
test.on[test.of](...test.in) // Must use `...`.
|
|
130
|
+
}
|
|
131
|
+
catch (thrown) {
|
|
132
|
+
test.actual = thrown.message;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Comparing. */
|
|
136
|
+
test.didPass = this.#compare(test.out, test.actual);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// region Dependencies of test frames
|
|
140
|
+
|
|
141
|
+
#anyOriginalPropertyGetting(target, settables) {
|
|
142
|
+
if (!Array.isArray(settables)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
let unsettables = [ ];
|
|
147
|
+
|
|
148
|
+
for (let settable of settables) {
|
|
149
|
+
// Not a setter tuple.
|
|
150
|
+
if (!settable.of) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Retaining original.
|
|
155
|
+
let original = target[settable.of];
|
|
156
|
+
let unsettable = { of: settable.of, as: original };
|
|
157
|
+
unsettables.push(unsettable);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return unsettables;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
#anyPropertySetting(target, settables) {
|
|
164
|
+
// No properties to set.
|
|
165
|
+
if (!Array.isArray(settables)) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
for (let settable of settables) {
|
|
170
|
+
// Not a setter tuple.
|
|
171
|
+
if (!settable.of) {
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Actually setting property.
|
|
176
|
+
target[settable.of] = settable.as;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
#anyPropertyUnsetting(target, unsettables) {
|
|
181
|
+
// Unsetting is the same as setting,
|
|
182
|
+
// but with tuples of original values.
|
|
183
|
+
return this.#anyPropertySetting(target, unsettables);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
#compare(expected, actual) {
|
|
187
|
+
return this.#comparer.compare(expected, actual);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
#supplyNonReturnActual(test, target) {
|
|
191
|
+
// When there is a .from that's a string,
|
|
192
|
+
// the actual is the named target member.
|
|
193
|
+
if (typeof test.from === "string") {
|
|
194
|
+
// Common member host;
|
|
195
|
+
// undefined if static.
|
|
196
|
+
let host = target;
|
|
197
|
+
|
|
198
|
+
// When .and defines static.
|
|
199
|
+
if (this.#doesAddressStatics(test)) {
|
|
200
|
+
host = test.on;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return host[test.from];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// When there is a .from that's a function,
|
|
207
|
+
// the actual is the result of calling it,
|
|
208
|
+
// given everything that might be needed.
|
|
209
|
+
if (test.from instanceof Function) {
|
|
210
|
+
return test.from(target, test);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// When there is any other .from, the actual is the
|
|
214
|
+
// value of the code element provided as .from.
|
|
215
|
+
return test.from;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* &cruft : refactor to merge with same on TestFrameChooser */
|
|
219
|
+
#doesAddressStatics(test) {
|
|
220
|
+
if (typeof test.and === "string") {
|
|
221
|
+
if (test.and.includes(this.staticName)) {
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// endregion Dependencies of test frames
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**/
|
|
2
|
+
|
|
3
|
+
import { TotalDisplayer } from "./TotalDisplayer.js";
|
|
4
|
+
|
|
5
|
+
export class TestResult {
|
|
6
|
+
// region Components
|
|
7
|
+
|
|
8
|
+
#displayer;
|
|
9
|
+
|
|
10
|
+
// endregion Components
|
|
11
|
+
|
|
12
|
+
// region Fields
|
|
13
|
+
|
|
14
|
+
#test;
|
|
15
|
+
|
|
16
|
+
#identityText;
|
|
17
|
+
#initorsText;
|
|
18
|
+
#inputsText;
|
|
19
|
+
#expectedText;
|
|
20
|
+
#actualText;
|
|
21
|
+
|
|
22
|
+
#didPass;
|
|
23
|
+
#actual;
|
|
24
|
+
#thrown;
|
|
25
|
+
|
|
26
|
+
// endregion Fields
|
|
27
|
+
|
|
28
|
+
// region Source properties
|
|
29
|
+
|
|
30
|
+
get test() {
|
|
31
|
+
return this.#test;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set test(value) {
|
|
35
|
+
this.#test = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// endregion Source properties
|
|
39
|
+
|
|
40
|
+
// region Nature properties
|
|
41
|
+
|
|
42
|
+
get identityText() {
|
|
43
|
+
return this.#identityText;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
set identityText(value) {
|
|
47
|
+
this.#identityText = value;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get initorsText() {
|
|
51
|
+
return this.#initorsText;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
set initorsText(value) {
|
|
55
|
+
this.#initorsText = value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get inputsText() {
|
|
59
|
+
return this.#inputsText;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set inputsText(value) {
|
|
63
|
+
this.#inputsText = value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get expectedText() {
|
|
67
|
+
return this.#expectedText;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set expectedText(value) {
|
|
71
|
+
this.#expectedText = value;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// endregion Nature properties
|
|
75
|
+
|
|
76
|
+
// region Outcome properties
|
|
77
|
+
|
|
78
|
+
get actualText() {
|
|
79
|
+
return this.#actualText;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
set actualText(value) {
|
|
83
|
+
this.#actualText = value;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
get didPass() {
|
|
87
|
+
return this.#didPass;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
set didPass(value) {
|
|
91
|
+
this.#didPass = value;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
get anyThrow() {
|
|
95
|
+
return this.#thrown;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
set anyThrow(value) {
|
|
99
|
+
this.#thrown = value;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// endregion Outcome properties
|
|
103
|
+
|
|
104
|
+
// region Construction
|
|
105
|
+
|
|
106
|
+
constructor(test) {
|
|
107
|
+
this.#test = test;
|
|
108
|
+
this.#displayer = new TotalDisplayer();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// endregion Construction
|
|
112
|
+
|
|
113
|
+
// region Before run: setNature() and dependencies
|
|
114
|
+
|
|
115
|
+
setNature() {
|
|
116
|
+
this.#identityText = this.#calculateIdentityText();
|
|
117
|
+
this.#initorsText = this.#calculateInitorsText();
|
|
118
|
+
this.#inputsText = this.#calculateInputsText();
|
|
119
|
+
this.#expectedText = this.#calculateExpectedText();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#calculateIdentityText() {
|
|
123
|
+
let text = `${ this.test.for } `;
|
|
124
|
+
return text;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#calculateInitorsText() {
|
|
128
|
+
let text = this.#displayItemRow(this.test.with);
|
|
129
|
+
text = `Initors: ${ text }. `;
|
|
130
|
+
return text;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
#calculateInputsText() {
|
|
134
|
+
let text = this.#displayItemRow(this.test.in);
|
|
135
|
+
text = `Inputs: ${ text }. `;
|
|
136
|
+
return text;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
#calculateExpectedText() {
|
|
140
|
+
let text = this.#displaySingleItem(this.test.out);
|
|
141
|
+
text = `Expected: ${ text }. `;
|
|
142
|
+
return text;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// endregion Before run: setNature() and dependencies
|
|
146
|
+
|
|
147
|
+
// region After run: setResults() and dependencies
|
|
148
|
+
|
|
149
|
+
setResults() {
|
|
150
|
+
// Direct results.
|
|
151
|
+
this.#didPass = this.test.didPass;
|
|
152
|
+
this.#actual = this.test.actual;
|
|
153
|
+
this.#thrown = this.test.anyThrow;
|
|
154
|
+
|
|
155
|
+
// Derived displayable results.
|
|
156
|
+
this.#actualText = this.#calculateActualText();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
#calculateActualText() {
|
|
160
|
+
let text = this.#displaySingleItem(this.test.actual);
|
|
161
|
+
text = `Actual: ${ text }. `;
|
|
162
|
+
return text;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// endregion After run: setResults() and dependencies
|
|
166
|
+
|
|
167
|
+
// region Displaying test args
|
|
168
|
+
|
|
169
|
+
#displaySingleItem(item) /* verified */ {
|
|
170
|
+
return this.#displayer.display(item);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
#displayItemRow(row) /* verified */ {
|
|
174
|
+
let items = row.map(
|
|
175
|
+
x => this.#displayer.display(x)
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
if (items.length === 0) {
|
|
179
|
+
return [ "\u2014" ];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return items.join(`, `);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// endregion Displaying test args
|
|
186
|
+
|
|
187
|
+
}
|