risei 1.0.4 → 1.1.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.
Files changed (78) hide show
  1. package/README.md +236 -339
  2. package/index.js +8 -8
  3. package/package.json +23 -9
  4. package/{public/javascript → system}/ASpoofingFixture.js +1 -1
  5. package/{public/javascript → system}/ChosenTestFinder.js +4 -3
  6. package/{public/javascript → system}/SpoofClassMethodsFixture.js +38 -22
  7. package/system/SpoofObjectMethodsFixture.js +58 -0
  8. package/{public/javascript → system}/SpoofTuple.js +14 -1
  9. package/{public/javascript → system}/TerminalReporter.js +249 -222
  10. package/system/TestFrame.js +187 -0
  11. package/system/TestFrameChooser.js +54 -0
  12. package/system/TestFrames.js +232 -0
  13. package/system/TestResult.js +187 -0
  14. package/system/TestRunner.js +280 -0
  15. package/system/TestStages.js +278 -0
  16. package/{public/javascript → system}/TestTuple.js +132 -13
  17. package/{public/javascript → system}/TotalComparer.js +12 -0
  18. package/system/TotalCopier.js +79 -0
  19. package/system/TotalDisplayer.js +143 -0
  20. package/system/TypeAnalyzer.js +103 -0
  21. package/system/TypeIdentifier.js +70 -0
  22. package/system/Types.js +17 -0
  23. package/tests/other-tests/ASpoofingFixture.tests.js +242 -0
  24. package/tests/other-tests/SpoofClassesFixture.tests.js +130 -0
  25. package/tests/other-tests/SpoofObjectsFixture.tests.js +95 -0
  26. package/tests/other-tests/SpoofTuple.tests.js +93 -0
  27. package/tests/other-tests/TotalComparer.tests.js +920 -0
  28. package/tests/other-tests/package.json +7 -0
  29. package/tests/risei-tests/ASpoofingFixtureTests.rt.js +51 -0
  30. package/tests/risei-tests/MomentTests.rt.js +103 -0
  31. package/tests/risei-tests/SpoofTupleTests.rt.js +274 -0
  32. package/tests/risei-tests/TestFrameChooserTests.rt.js +74 -0
  33. package/tests/risei-tests/TestFrameTests.rt.js +84 -0
  34. package/tests/risei-tests/TestStagesTests.rt.js +99 -0
  35. package/tests/risei-tests/TestTupleTests.rt.js +140 -0
  36. package/tests/risei-tests/TotalComparerTests.rt.js +184 -0
  37. package/tests/risei-tests/TotalCopierTests.rt.js +74 -0
  38. package/tests/risei-tests/TotalDisplayerTests.rt.js +186 -0
  39. package/tests/risei-tests/TypeAnalyzerTests.rt.js +29 -0
  40. package/tests/risei-tests/TypeIdentifierTests.rt.js +44 -0
  41. package/tests/self-tests/SelfTests.outward-rt.js +583 -0
  42. package/tests/target-objects/CompositionModel.js +38 -0
  43. package/tests/target-objects/ConditionalThrowModel.js +11 -0
  44. package/tests/target-objects/CountModel.js +46 -0
  45. package/tests/target-objects/DomModel.js +37 -0
  46. package/tests/target-objects/MixedContents.js +33 -0
  47. package/tests/target-objects/MutationModel.js +27 -0
  48. package/tests/target-objects/ObjectCompositionModel.js +34 -0
  49. package/tests/target-objects/PolySpoofableInner.js +30 -0
  50. package/tests/target-objects/PolySpoofableOuter.js +52 -0
  51. package/tests/target-objects/PropertiesModel.js +47 -0
  52. package/tests/target-objects/Returner.js +9 -0
  53. package/tests/target-objects/SearchModel.js +25 -0
  54. package/tests/target-objects/SortModel.js +91 -0
  55. package/tests/target-objects/SpoofCaller.js +24 -0
  56. package/tests/target-objects/Spoofable.js +36 -0
  57. package/tests/target-objects/SpoofableArgsCaller.js +33 -0
  58. package/tests/target-objects/StateModel.js +34 -0
  59. package/tests/target-objects/StaticModel.js +17 -0
  60. package/tests/target-objects/TestableModel.js +47 -0
  61. package/tests/topic-tests/TopicTests.outward-rt.js +354 -0
  62. package/public/javascript/SpoofObjectMethodsFixture.js +0 -52
  63. package/public/javascript/TestResult.js +0 -338
  64. package/public/javascript/TestRunner.js +0 -476
  65. /package/{public/javascript → system}/AComparer.js +0 -0
  66. /package/{public/javascript → system}/ATestCaller.js +0 -0
  67. /package/{public/javascript → system}/ATestFinder.js +0 -0
  68. /package/{public/javascript → system}/ATestFixture.js +0 -0
  69. /package/{public/javascript → system}/ATestReporter.js +0 -0
  70. /package/{public/javascript → system}/ATestSource.js +0 -0
  71. /package/{public/javascript → system}/ClassTestGroup.js +0 -0
  72. /package/{public/javascript → system}/LocalCaller.js +0 -0
  73. /package/{public/javascript → system}/MethodTestGroup.js +0 -0
  74. /package/{public/javascript → system}/Moment.js +0 -0
  75. /package/{public/javascript → system}/Risei.js +0 -0
  76. /package/{public/javascript → system}/TestFinder.js +0 -0
  77. /package/{public/javascript → system}/TestGroup.js +0 -0
  78. /package/{public/javascript → system}/TestSummary.js +0 -0
@@ -1,222 +1,249 @@
1
- /**/
2
-
3
- /* TerminalReporter is an ATestReporter that sends each result to the terminal / console for display. */
4
-
5
- import { ATestReporter } from "./ATestReporter.js";
6
- import { TestGroup } from "./TestGroup.js";
7
- import { ClassTestGroup } from "./ClassTestGroup.js";
8
- import { MethodTestGroup } from "./MethodTestGroup.js";
9
- import { TestResult } from "./TestResult.js";
10
- import { TestSummary } from "./TestSummary.js";
11
-
12
- import chalk from "chalk";
13
-
14
- export class TerminalReporter extends ATestReporter {
15
- // region Private fields
16
-
17
- /* Foreground-colors using dependency calls and hex. */
18
- #trueWhite = chalk.hex("FFFFFF");
19
- #trueBlack = chalk.hex("000000");
20
-
21
- /* Background colors as hex for dependency
22
- calls to use, needed syntactically. */
23
- #blue = "0000CD";
24
- #aqua = "00BFFF";
25
- #paleGreen = "90EE90";
26
- #paleRed = "F08080";
27
-
28
- /* Full fore- and background color output styles. */
29
-
30
- #classGroup = this.#trueWhite.bgHex(this.#blue).bold;
31
- #methodGroup = this.#trueWhite.bgHex(this.#aqua).bold;
32
- #passed = this.#trueBlack.bgHex(this.#paleGreen);
33
- #failed = this.#trueBlack.bgHex(this.#paleRed);
34
- #passedSummary = this.#trueBlack.bgHex(this.#paleGreen).bold;
35
- #failedSummary = this.#trueBlack.bgHex(this.#paleRed).bold;
36
- #summary = chalk.hex("000080").bgHex("FAFAD2").bold;
37
-
38
- // Count of characters used for indent
39
- // and text to the left of each test.
40
- #preUsedWidth = 20;
41
-
42
- // endregion PrivateFields
43
-
44
- // region ATestReporter
45
-
46
- reportNext(result) {
47
- // The next result introduces a group of tests.
48
- if (result instanceof TestGroup) {
49
- this.reportGroup(result);
50
- return;
51
- }
52
-
53
- // The next result is from one test.
54
- if (result instanceof TestResult) {
55
- this.#reportTestResult(result);
56
- return;
57
- }
58
-
59
- // The next result is the summary of all tests.
60
- if (result instanceof TestSummary) {
61
- this.reportSummary(result);
62
- return;
63
- }
64
- }
65
-
66
- reportGroup(result) {
67
- if (result instanceof ClassTestGroup) {
68
- console.log(this.#classGroup(` ${ result.group }: `));
69
- }
70
-
71
- if (result instanceof MethodTestGroup) {
72
- console.log(" " + this.#methodGroup(` ${ result.group }(): `));
73
- }
74
- }
75
-
76
- // region Private dependencies of reportNext()
77
-
78
- #reportTestResult(result) {
79
- if (result.didPass) {
80
- this.reportPassed(result);
81
- }
82
-
83
- if (!result.didPass) {
84
- this.reportFailed(result);
85
- }
86
- }
87
-
88
- // endregion Private dependencies of reportNext()
89
-
90
- reportPassed(result) {
91
- this.#reportOneTestResult(result, "Passed", this.#passed);
92
- }
93
-
94
- reportFailed(result) {
95
- this.#reportOneTestResult(result, "Failed", this.#failed);
96
- }
97
-
98
- // region Private dependencies of reportPassed() and reportFailed()
99
-
100
- /* cruft, changes here */
101
- #reportOneTestResult(result, net, styler) {
102
- let { lineOne, lineTwo, lineThree } = this.#calculateResultDisplay(result);
103
-
104
- console.log(
105
- "\t" + styler(` ${ net }: ${ lineOne }`)
106
- );
107
-
108
- if (lineTwo) {
109
- console.log(
110
- "\t\t " + styler(` ${ lineTwo }`)
111
- );
112
- }
113
-
114
- if (lineThree) {
115
- console.log(
116
- "\t\t " + styler(` ${ lineThree }`)
117
- );
118
- }
119
- }
120
-
121
- /* &cruft, changes here and/or factoring
122
- to lengths and tactics branching */
123
- #calculateResultDisplay(result) {
124
- /* Getting lengths to determine if output should
125
- * be split to multiple lines to fit the window. */
126
-
127
- let forInputsLength
128
- = this.#preUsedWidth
129
- + result.identityText.length
130
- + result.inputsText.length;
131
-
132
- let allLength
133
- = forInputsLength
134
- + result.expectedText.length
135
- + result.actualText.length;
136
-
137
- /* Splitting as much as is needed. */
138
-
139
- let identityText = result.identityText;
140
- let inputsText = result.inputsText;
141
- let expectedText = result.expectedText;
142
- let actualText = result.actualText;
143
-
144
- if (forInputsLength >= process.stdout.columns) {
145
- return this.#threeLineTactic(identityText, inputsText, expectedText, actualText);
146
- }
147
-
148
- if (allLength >= process.stdout.columns) {
149
- return this.#twoLineTactic(identityText, inputsText, expectedText, actualText);
150
- }
151
-
152
- return this.#oneLineTactic(identityText, inputsText, expectedText, actualText);
153
- }
154
-
155
- // region Private dependencies of #calculateResultDisplay()
156
-
157
- #threeLineTactic(identityText, inputsText, expectedText, actualText) {
158
- // Each line, with two spaces between phrases on same line.
159
- let lineOne = identityText;
160
- let lineTwo = inputsText;
161
- let lineThree = expectedText + " " + actualText;
162
-
163
- return { lineOne, lineTwo, lineThree };
164
- }
165
-
166
- #twoLineTactic(identityText, inputsText, expectedText, actualText) {
167
- // Each line, with two spaces between phrases on same line.
168
- let lineOne = identityText + " " + inputsText;
169
- let lineTwo = expectedText + " " + actualText;
170
-
171
- // Left undefined.
172
- let lineThree;
173
-
174
- return { lineOne, lineTwo, lineThree };
175
- }
176
-
177
- #oneLineTactic(identityText, inputsText, expectedText, actualText) {
178
- // Single line, with two spaces between all phrases.
179
- let lineOne
180
- = identityText
181
- + " "
182
- + inputsText
183
- + " "
184
- + expectedText
185
- + " "
186
- + actualText;
187
-
188
- // Left undefined.
189
- let lineTwo, lineThree;
190
-
191
- return { lineOne, lineTwo, lineThree };
192
- }
193
-
194
- // endregion Private dependencies of #calculateResultDisplay()
195
-
196
- // endregion Private dependencies of reportPassed() and reportFailed()
197
-
198
- reportSummary(summary) {
199
- console.log();
200
-
201
- if (summary.anyWereRun) {
202
- if (summary.allDidPass) {
203
- console.log(this.#passedSummary(this.#toFullWidth(" Test run succeeded.")));
204
- }
205
- else {
206
- console.log(this.#failedSummary(this.#toFullWidth(" Test run failed.")));
207
- }
208
- }
209
-
210
- console.log(this.#summary(this.#toFullWidth(` ${ summary.summary }`)));
211
- }
212
-
213
- #toFullWidth(text) {
214
- text = text || "";
215
- let width = process.stdout.columns;
216
-
217
- return text.padEnd(width, "\u00A0");
218
- }
219
-
220
- // endregion ATestReporter
221
-
222
- }
1
+ /**/
2
+
3
+ /* TerminalReporter is an ATestReporter that sends each result to the terminal / console for display. */
4
+
5
+ import { ATestReporter } from "./ATestReporter.js";
6
+ import { TestGroup } from "./TestGroup.js";
7
+ import { ClassTestGroup } from "./ClassTestGroup.js";
8
+ import { MethodTestGroup } from "./MethodTestGroup.js";
9
+ import { TestResult } from "./TestResult.js";
10
+ import { TestSummary } from "./TestSummary.js";
11
+
12
+ import chalk from "chalk";
13
+
14
+ export class TerminalReporter extends ATestReporter {
15
+ // region Private fields
16
+
17
+ /* Foreground-colors using dependency calls and hex. */
18
+ #trueWhite = chalk.hex("FFFFFF");
19
+ #trueBlack = chalk.hex("000000");
20
+
21
+ /* Background colors as hex for dependency
22
+ calls to use, needed syntactically. */
23
+ #blue = "0000CD";
24
+ #aqua = "00BFFF";
25
+ #paleGreen = "90EE90";
26
+ #paleRed = "F08080";
27
+
28
+ /* Full fore- and background color output styles. */
29
+
30
+ #classGroup = this.#trueWhite.bgHex(this.#blue).bold;
31
+ #methodGroup = this.#trueWhite.bgHex(this.#aqua).bold;
32
+ #passed = this.#trueBlack.bgHex(this.#paleGreen);
33
+ #failed = this.#trueBlack.bgHex(this.#paleRed);
34
+ #passedSummary = this.#trueBlack.bgHex(this.#paleGreen).bold;
35
+ #failedSummary = this.#trueBlack.bgHex(this.#paleRed).bold;
36
+ #summary = chalk.hex("000080").bgHex("FAFAD2").bold;
37
+
38
+ // Count of characters used for indent
39
+ // and text to the left of each test.
40
+ #preUsedWidth = 20;
41
+
42
+ // endregion PrivateFields
43
+
44
+ // region ATestReporter
45
+
46
+ reportNext(result) {
47
+ // The next result introduces a group of tests.
48
+ if (result instanceof TestGroup) {
49
+ this.reportGroup(result);
50
+ return;
51
+ }
52
+
53
+ // The next result is from one test.
54
+ if (result instanceof TestResult) {
55
+ this.#reportTestResult(result);
56
+ return;
57
+ }
58
+
59
+ // The next result is the summary of all tests.
60
+ if (result instanceof TestSummary) {
61
+ this.reportSummary(result);
62
+ return;
63
+ }
64
+ }
65
+
66
+ reportGroup(result) {
67
+ if (result instanceof ClassTestGroup) {
68
+ console.log(this.#classGroup(` ${ result.group }: `));
69
+ }
70
+
71
+ if (result instanceof MethodTestGroup) {
72
+ console.log(" " + this.#methodGroup(` ${ result.group }(): `));
73
+ }
74
+ }
75
+
76
+ // region Private dependencies of reportNext()
77
+
78
+ #reportTestResult(result) {
79
+ if (result.didPass) {
80
+ this.reportPassed(result);
81
+ }
82
+
83
+ if (!result.didPass) {
84
+ this.reportFailed(result);
85
+ }
86
+ }
87
+
88
+ // endregion Private dependencies of reportNext()
89
+
90
+ reportPassed(result) {
91
+ this.#reportOneTestResult(result, "Passed", this.#passed);
92
+ }
93
+
94
+ reportFailed(result) {
95
+ this.#reportOneTestResult(result, "Failed", this.#failed);
96
+ }
97
+
98
+ // region Private dependencies of reportPassed() and reportFailed()
99
+
100
+ /* &cruft, changes here / in dependencies
101
+ for better splitting to multiple lines */
102
+ #reportOneTestResult(result, net, styler) {
103
+ let { lineOne, lineTwo, lineThree, lineFour } = this.#calculateResultDisplay(result);
104
+
105
+ console.log(
106
+ "\t" + styler(` ${ net }: ${ lineOne }`)
107
+ );
108
+
109
+ if (lineTwo) {
110
+ console.log(
111
+ "\t\t " + styler(` ${ lineTwo }`)
112
+ );
113
+ }
114
+
115
+ if (lineThree) {
116
+ console.log(
117
+ "\t\t " + styler(` ${ lineThree }`)
118
+ );
119
+ }
120
+
121
+ if (lineFour) {
122
+ console.log(
123
+ "\t\t " + styler(` ${ lineFour }`)
124
+ );
125
+ }
126
+ }
127
+
128
+ #calculateResultDisplay(result) {
129
+ /* Getting lengths to determine if output should
130
+ * be split to multiple lines to fit the window. */
131
+
132
+ let forInputsLength
133
+ = this.#preUsedWidth
134
+ + result.identityText.length
135
+ + result.inputsText.length;
136
+
137
+ let allLength
138
+ = forInputsLength
139
+ + result.expectedText.length
140
+ + result.actualText.length;
141
+
142
+ let forOutputsLength
143
+ = this.#preUsedWidth
144
+ + result.expectedText.length
145
+ + result.actualText.length;
146
+
147
+ /* Splitting as much as is needed. */
148
+
149
+ let identityText = result.identityText;
150
+ let inputsText = result.inputsText;
151
+ let expectedText = result.expectedText;
152
+ let actualText = result.actualText;
153
+
154
+ if (forOutputsLength >= process.stdout.columns) {
155
+ return this.#fourLineTactic(identityText, inputsText, expectedText, actualText);
156
+ }
157
+
158
+ if (forInputsLength >= process.stdout.columns) {
159
+ return this.#threeLineTactic(identityText, inputsText, expectedText, actualText);
160
+ }
161
+
162
+ if (allLength >= process.stdout.columns) {
163
+ return this.#twoLineTactic(identityText, inputsText, expectedText, actualText);
164
+ }
165
+
166
+ return this.#oneLineTactic(identityText, inputsText, expectedText, actualText);
167
+ }
168
+
169
+ // region Private dependencies of #calculateResultDisplay()
170
+
171
+ #fourLineTactic(identityText, inputsText, expectedText, actualText) {
172
+ // Each line on its own.
173
+ let lineOne = identityText;
174
+ let lineTwo = inputsText;
175
+ let lineThree = expectedText;
176
+ let lineFour = actualText;
177
+
178
+ return { lineOne, lineTwo, lineThree, lineFour };
179
+ }
180
+
181
+ #threeLineTactic(identityText, inputsText, expectedText, actualText) {
182
+ // Each line, with two spaces between phrases on same line.
183
+ let lineOne = identityText;
184
+ let lineTwo = inputsText;
185
+ let lineThree = expectedText + " " + actualText;
186
+
187
+ // Left undefined.
188
+ let lineFour;
189
+
190
+ return { lineOne, lineTwo, lineThree, lineFour };
191
+ }
192
+
193
+ #twoLineTactic(identityText, inputsText, expectedText, actualText) {
194
+ // Each line, with two spaces between phrases on same line.
195
+ let lineOne = identityText + " " + inputsText;
196
+ let lineTwo = expectedText + " " + actualText;
197
+
198
+ // Left undefined.
199
+ let lineThree, lineFour;
200
+
201
+ return { lineOne, lineTwo, lineThree, lineFour };
202
+ }
203
+
204
+ #oneLineTactic(identityText, inputsText, expectedText, actualText) {
205
+ // Single line, with two spaces between all phrases.
206
+ let lineOne
207
+ = identityText
208
+ + " "
209
+ + inputsText
210
+ + " "
211
+ + expectedText
212
+ + " "
213
+ + actualText;
214
+
215
+ // Left undefined.
216
+ let lineTwo, lineThree, lineFour;
217
+
218
+ return { lineOne, lineTwo, lineThree, lineFour };
219
+ }
220
+
221
+ // endregion Private dependencies of #calculateResultDisplay()
222
+
223
+ // endregion Private dependencies of reportPassed() and reportFailed()
224
+
225
+ reportSummary(summary) {
226
+ console.log();
227
+
228
+ if (summary.anyWereRun) {
229
+ if (summary.allDidPass) {
230
+ console.log(this.#passedSummary(this.#toFullWidth(" Test run succeeded.")));
231
+ }
232
+ else {
233
+ console.log(this.#failedSummary(this.#toFullWidth(" Test run failed.")));
234
+ }
235
+ }
236
+
237
+ console.log(this.#summary(this.#toFullWidth(` ${ summary.summary }`)));
238
+ }
239
+
240
+ #toFullWidth(text) {
241
+ text = text || "";
242
+ let width = process.stdout.columns;
243
+
244
+ return text.padEnd(width, "\u00A0");
245
+ }
246
+
247
+ // endregion ATestReporter
248
+
249
+ }
@@ -0,0 +1,187 @@
1
+ /**/
2
+
3
+ import { TestStages } from "./TestStages.js";
4
+
5
+ export class TestFrame {
6
+ /* &cruft : when TestStages is ready, use it and its methods here */
7
+
8
+ #stages;
9
+
10
+ constructor() {
11
+ // A TestStages is inited for each test.
12
+ this.#stages = new TestStages();
13
+ }
14
+
15
+ testFrame(test) {
16
+ console.log(`cruft : a`);
17
+ // Outer try for fails of groundwork requested.
18
+ try {
19
+ console.log(`cruft : b`);
20
+ /* &cruft, maybe simplify explanations here */
21
+
22
+ // Certain args must be isolated for collapsing forward, in case tested
23
+ // code mutates them. Sets test.localInitors and test.localInputs.
24
+ this.#stages.setLocalInitorsAndInputs(test);
25
+
26
+ console.log(`cruft : c`);
27
+
28
+ // Spoofing, setting static properties, and so on.
29
+ this.#stages.anyPreTargetingGroundwork(test);
30
+
31
+ console.log(`cruft : d`);
32
+
33
+ // Target may be instance, prototype for constructors, the class
34
+ // itself for statics, or nonce for properties. Sets test.target.
35
+ this.#stages.setLocalTarget(test);
36
+
37
+ console.log(`cruft : e`);
38
+
39
+ // Method under test may be on instance, class,
40
+ // or nonce for properties. Sets test.callable.
41
+ this.#stages.setLocalCallable(test);
42
+
43
+ console.log(`cruft : f`);
44
+
45
+ // Setting instance properties and so on.
46
+ this.#stages.anyPostTargetingGroundwork(test);
47
+
48
+
49
+ console.log(`cruft : g`);
50
+
51
+ // Inner try for fails of targeted code only.
52
+ try {
53
+ console.log(`cruft : h`);
54
+
55
+ console.log(`cruft : test.actual:`, test.actual);
56
+ console.log(`cruft : test.localTarget:`, test.localTarget);
57
+ console.log(`cruft : test.localCallable:`, test.localCallable);
58
+ console.log(`cruft : test.localInputs:`, test.localInputs);
59
+
60
+ // Tests usually look for this.
61
+ test.actual = test.localTarget[test.localCallable](...test.localInputs);
62
+
63
+ console.log(`cruft : test.actual:`, test.actual);
64
+ console.log(`cruft : i`);
65
+ }
66
+ catch (thrown) {
67
+ console.log(`cruft : j`);
68
+
69
+ // Sometimes tests look for this.
70
+ test.thrown = thrown;
71
+
72
+ console.log(`cruft : k`);
73
+ }
74
+
75
+ console.log(`cruft : l`);
76
+
77
+ // Sometimes tests look for results elsewhere.
78
+ this.#stages.anyModifyActual(test);
79
+
80
+ console.log(`cruft : m`);
81
+
82
+ /* &cruft, remove test-checking line when all tests pass */
83
+ // test.didPass = "fails";
84
+
85
+ // Actually testing the result.
86
+ test.didPass = this.#stages.compareResults(test.output, test.actual);
87
+
88
+ console.log(`cruft : n`);
89
+
90
+ }
91
+ finally {
92
+ console.log(`cruft : o`);
93
+
94
+ // Undoing any groundwork changes made.
95
+ this.#stages.anyGroundworkReversion(test);
96
+
97
+ console.log(`cruft : p`);
98
+ }
99
+
100
+ console.log(`cruft : q`);
101
+ }
102
+
103
+ // // region Dependencies of test frames
104
+ //
105
+ // /* &cruft, remove if / once superseded by code in TestStages */
106
+ //
107
+ // #anyOriginalPropertyGetting(target, settables) {
108
+ // if (!Array.isArray(settables)) {
109
+ // return;
110
+ // }
111
+ //
112
+ // let unsettables = [ ];
113
+ //
114
+ // for (let settable of settables) {
115
+ // // Not a setter tuple.
116
+ // if (!settable.of) {
117
+ // continue;
118
+ // }
119
+ //
120
+ // // Retaining original.
121
+ // let original = target[settable.of];
122
+ // let unsettable = { of: settable.of, as: original };
123
+ // unsettables.push(unsettable);
124
+ // }
125
+ //
126
+ // return unsettables;
127
+ // }
128
+ //
129
+ // #anyPropertySetting(target, settables) {
130
+ // // No properties to set.
131
+ // if (!Array.isArray(settables)) {
132
+ // return;
133
+ // }
134
+ //
135
+ // for (let settable of settables) {
136
+ // // Not a setter tuple.
137
+ // if (!settable.of) {
138
+ // continue;
139
+ // }
140
+ //
141
+ // // Actually setting property.
142
+ // target[settable.of] = settable.as;
143
+ // }
144
+ // }
145
+ //
146
+ // #anyPropertyUnsetting(target, unsettables) {
147
+ // // Unsetting is the same as setting,
148
+ // // but with tuples of original values.
149
+ // return this.#anyPropertySetting(target, unsettables);
150
+ // }
151
+ //
152
+ // // #compare(expected, actual) {
153
+ // // return this.#comparer.compare(expected, actual);
154
+ // // }
155
+ //
156
+ // #supplyNonReturnActual(test, target) {
157
+ // // When there is a .from that's a string,
158
+ // // the actual is the named target member.
159
+ // if (typeof test.from === "string") {
160
+ // // Common member host;
161
+ // // undefined if static.
162
+ // let host = target;
163
+ //
164
+ // // When .and defines static.
165
+ // if (this.#doesAddressStatics(test)) {
166
+ // host = test.on;
167
+ // }
168
+ //
169
+ // return host[test.from];
170
+ // }
171
+ //
172
+ // // When there is a .from that's a function,
173
+ // // the actual is the result of calling it,
174
+ // // given everything that might be needed.
175
+ // if (test.from instanceof Function) {
176
+ // return test.from(target, test);
177
+ // }
178
+ //
179
+ // // When there is any other .from, the actual is the
180
+ // // value of the code element provided as .from.
181
+ // return test.from;
182
+ // }
183
+ //
184
+ // // endregion Dependencies of test frames
185
+ //
186
+
187
+ }