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
@@ -0,0 +1,242 @@
1
+ /**/
2
+
3
+ import { ASpoofingFixture } from "../../system/ASpoofingFixture.js";
4
+ import { SpoofTuple } from "../../system/SpoofTuple.js";
5
+ import { TotalComparer } from "../../system/TotalComparer.js";
6
+ import { expect } from "chai";
7
+
8
+ describe("ASpoofingFixture", () => {
9
+ /* All the tests here are valid as long as TotalComparer
10
+ and any linked objects are passing all their tests. */
11
+ let comparer = new TotalComparer();
12
+
13
+ /* Some cases here are effectively impossible to test directly in self-tests, at least
14
+ without complicated workarounds, because of how SpoofTuple is used by Kitten tests. */
15
+
16
+ describe("spoofMethod()", () => {
17
+ describe("Direct tests: Definition of spoofed method is compared.", () => {
18
+ it("Should return an empty method when not provided an arg.", /* good */ () => {
19
+ let target = new ASpoofingFixture();
20
+
21
+ let expected = () => { };
22
+
23
+ let actual = target.spoofMethod();
24
+
25
+ let comparison = comparer.compare(expected, actual);
26
+ expect(comparison).to.be.true;
27
+ });
28
+
29
+ it("Should return an empty method when not provided undefined as arg.", /* good */ () => {
30
+ let target = new ASpoofingFixture();
31
+
32
+ let expected = () => { };
33
+
34
+ let actual = target.spoofMethod(undefined);
35
+
36
+ let comparison = comparer.compare(expected, actual);
37
+ expect(comparison).to.be.true;
38
+ });
39
+
40
+ it("Should return any whole function supplied as arg.", /* good */ () => {
41
+ let target = new ASpoofingFixture();
42
+
43
+ let expected = () => {
44
+ let sum = 6 + 5;
45
+ console.log(sum);
46
+ };
47
+
48
+ let actual = target.spoofMethod(expected);
49
+
50
+ let comparison = comparer.compare(expected, actual);
51
+ expect(comparison).to.be.true;
52
+ });
53
+
54
+ it("Should return a simple method naming the parameter when any non-function arg supplied.", /* good */ () => {
55
+ let target = new ASpoofingFixture();
56
+
57
+ let expected = () => { return spoofOutput; };
58
+
59
+ let actual = target.spoofMethod(778);
60
+
61
+ let comparison = comparer.compare(expected, actual);
62
+ expect(comparison).to.be.true;
63
+ });
64
+ });
65
+
66
+ describe("Indirect tests: Result of calling spoofed method is tested.", () => {
67
+ it("Should return a simple method returning any value supplied as arg.", /* good */ () => {
68
+ let target = new ASpoofingFixture();
69
+
70
+ let expected = 322;
71
+
72
+ let spoofed = target.spoofMethod(322);
73
+ let actual = spoofed();
74
+
75
+ let comparison = comparer.compare(expected, actual);
76
+ expect(comparison).to.be.true;
77
+ });
78
+
79
+ it("Should return a simple method returning any string supplied as arg.", /* good */ () => {
80
+ let target = new ASpoofingFixture();
81
+
82
+ let expected = "A short text.";
83
+
84
+ let spoofed = target.spoofMethod("A short text.");
85
+ let actual = spoofed();
86
+
87
+ let comparison = comparer.compare(expected, actual);
88
+ expect(comparison).to.be.true;
89
+ });
90
+
91
+ it("Should return a simple method returning any object supplied as arg.", /* good */ () => {
92
+ let target = new ASpoofingFixture();
93
+
94
+ let expected = { first: "a", second: 2, third: "C" };
95
+
96
+ let spoofed = target.spoofMethod({ first: "a", second: 2, third: "C" });
97
+ let actual = spoofed();
98
+
99
+ let comparison = comparer.compare(expected, actual);
100
+ expect(comparison).to.be.true;
101
+ });
102
+
103
+ it("Should return a simple method returning any specialized object supplied as arg.", /* good */ () => {
104
+ let target = new ASpoofingFixture();
105
+
106
+ let expected = new Map([[1, "g"], [2, "k"]]);
107
+
108
+ let spoofed = target.spoofMethod(new Map([[1, "g"], [2, "k"]]));
109
+ let actual = spoofed();
110
+
111
+ let comparison = comparer.compare(expected, actual);
112
+ expect(comparison).to.be.true;
113
+ });
114
+
115
+ it("Should return a simple method returning any deep object supplied as arg", /* good */ () => {
116
+ let target = new ASpoofingFixture();
117
+ let arg = { these: { those: { the: { other: () => { return 44; } } } } };
118
+
119
+ let spoofed = target.spoofMethod(arg);
120
+ let actual = spoofed();
121
+
122
+ let expected = { these: { those: { the: { other: () => { return 44; } } } } };
123
+
124
+ let comparison = comparer.compare(expected, actual);
125
+ expect(comparison).to.be.true;
126
+ });
127
+
128
+ it("Should return a simple method returning any deep spoofed object defined in the arg.", /* good */ () => {
129
+ let target = new ASpoofingFixture();
130
+ let arg = [ { of: "these.those.the.other", as: 76 } ];
131
+
132
+ let spoofed = target.spoofMethod(arg);
133
+ let actual = spoofed();
134
+
135
+ let expected = { these: { those: { the: { other: () => { return spoofOutput; } } } } };
136
+
137
+ let comparison = comparer.compare(actual, expected);
138
+ expect(comparison).to.be.true;
139
+ });
140
+
141
+ });
142
+ });
143
+
144
+ describe("spoofObjectTree()", () => {
145
+ it("Should return (object(empty method)) when given one part and no output.", /* good */ () => {
146
+ let target = new ASpoofingFixture();
147
+ let arg = [{ of: "action" }];
148
+
149
+ let expected = { action: () => { } };
150
+
151
+ let actual = target.spoofObjectTree(arg);
152
+
153
+ let comparison = comparer.compare(expected, actual);
154
+ expect(comparison).to.be.true;
155
+ });
156
+
157
+ it("Should return (object(object(empty method))) when given two parts and no output.", /* good */ () => {
158
+ let target = new ASpoofingFixture();
159
+ let arg = [{ of: "thing.action" }];
160
+
161
+ let expected = { thing: { action: () => { } } };
162
+
163
+ let actual = target.spoofObjectTree(arg);
164
+
165
+ let comparison = comparer.compare(expected, actual);
166
+ expect(comparison).to.be.true;
167
+ });
168
+
169
+ it("Should return (object(object(object(empty method)))) when given three parts and no output.", /* good */ () => {
170
+ let target = new ASpoofingFixture()
171
+ let arg = [{ of: "outer.inner.action" }];
172
+
173
+ let expected = { outer: { inner: { action: () => { } } } };
174
+
175
+ let actual = target.spoofObjectTree(arg);
176
+
177
+ let comparison = comparer.compare(expected, actual);
178
+ expect(comparison).to.be.true;
179
+ });
180
+
181
+ it("Should return (object(value-returning method)) when given one part and an output value.", /* good */ () => {
182
+ let target = new ASpoofingFixture();
183
+ let arg = [{ of: "ten", as: 10 }];
184
+
185
+ let expected = { ten: () => { return spoofOutput; } };
186
+
187
+ let actual = target.spoofObjectTree(arg);
188
+
189
+ let comparison = comparer.compare(expected, actual);
190
+ expect(comparison).to.be.true;
191
+ });
192
+
193
+ it("Should return (object(object(value-returning method))) when given two parts and an output value.", /* good */ () => {
194
+ let target = new ASpoofingFixture();
195
+ let arg = [{ of: "thing.eleven", as: 11 }];
196
+
197
+ let expected = { thing: { eleven: () => { return spoofOutput; } } };
198
+
199
+ let actual = target.spoofObjectTree(arg);
200
+
201
+ let comparison = comparer.compare(expected, actual);
202
+ expect(comparison).to.be.true;
203
+ });
204
+
205
+ it("Should return (object(object(object(value-returning method)))) when given three parts and an output value.", /* good */ () => {
206
+ let target = new ASpoofingFixture();
207
+ let arg = [{ of: "outer.inner.twelve", as: 12 }];
208
+
209
+ let expected = { outer: { inner: { twelve: () => { return spoofOutput; } } } };
210
+
211
+ let actual = target.spoofObjectTree(arg);
212
+
213
+ let comparison = comparer.compare(expected, actual);
214
+ expect(comparison).to.be.true;
215
+ });
216
+
217
+ it("Should return (object(object(string-returning method))) when given two parts and an output string.", /* good */ () => {
218
+ let target = new ASpoofingFixture();
219
+ let arg = [{ of: "thing.outputText", as: "text-output" }];
220
+
221
+ let expected = { thing: { outputText: () => { return spoofOutput; } } };
222
+
223
+ let actual = target.spoofObjectTree(arg);
224
+
225
+ let comparison = comparer.compare(expected, actual);
226
+ expect(comparison).to.be.true;
227
+ });
228
+
229
+ it("Should return (object(object(nonce method))) when given two parts and a nonce method.", /* good */ () => {
230
+ let target = new ASpoofingFixture();
231
+ let arg = [{ of: "thing.sumIsFourteen", as: () => { return 11 + 3; } }];
232
+
233
+ let expected = { thing: { sumIsFourteen: () => { return 11 + 3; } } };
234
+
235
+ let actual = target.spoofObjectTree(arg);
236
+
237
+ let comparison = comparer.compare(expected, actual);
238
+ expect(comparison).to.be.true;
239
+ });
240
+
241
+ });
242
+ });
@@ -0,0 +1,130 @@
1
+ /**/
2
+
3
+ import { SpoofClassMethodsFixture } from "../../system/SpoofClassMethodsFixture.js";
4
+ import { Spoofable } from "../target-objects/Spoofable.js";
5
+ import { TotalComparer } from "../../system/TotalComparer.js";
6
+
7
+ import { expect } from "chai";
8
+
9
+ describe("SpoofClassMethodsFixture", () => {
10
+ let comparer = new TotalComparer();
11
+
12
+ describe("spoof()", () => {
13
+ describe("Direct tests: Definition of spoofed method is compared.", () => {
14
+ it("Should set class method to be empty when given args which define that.", /* good */ () => {
15
+ let target = new SpoofClassMethodsFixture();
16
+ let definition = { of: "spoofNumber" };
17
+ let arg = { on: Spoofable, plus: [ definition ] };
18
+
19
+ target.spoof(arg);
20
+
21
+ let actual = Spoofable.prototype.spoofNumber;
22
+
23
+ target.unspoof();
24
+
25
+ let comparison = comparer.compare(actual, () => { });
26
+ expect(comparison).to.be.true;
27
+ });
28
+
29
+ it("Should set class method to a known nonce function when given that nonce as an arg.", /* good */ () => {
30
+ let target = new SpoofClassMethodsFixture();
31
+ let definition = { of: "spoofNumber", as: (a, b) => { return b - a; } };
32
+ let arg = { on: Spoofable, plus: [ definition ] };
33
+
34
+ target.spoof(arg);
35
+
36
+ let actual = Spoofable.prototype.spoofNumber;
37
+
38
+ target.unspoof();
39
+
40
+ let comparison = comparer.compare(actual, (a, b) => { return b - a; });
41
+ expect(comparison).to.be.true;
42
+ });
43
+
44
+ it("Should set class method to a simple function returning a named parameter when given args which define that.", /* good */ () => {
45
+ let target = new SpoofClassMethodsFixture();
46
+ let definition = { of: "spoofNumber" , as: 32 };
47
+ let arg = { on: Spoofable, plus: [ definition ] };
48
+
49
+ target.spoof(arg);
50
+
51
+ let actual = Spoofable.prototype.spoofNumber;
52
+
53
+ target.unspoof();
54
+
55
+ let comparison = comparer.compare(actual, () => { return spoofOutput; });
56
+ expect(comparison).to.be.true;
57
+ });
58
+ })
59
+
60
+ describe("Indirect tests: Result of calling spoofed method is compared.", () => {
61
+ it("Should set class method to return a known value when given args which define that.", /* good */ () => {
62
+ let target = new SpoofClassMethodsFixture();
63
+ let definition = { of: "spoofNumber", as: 17 };
64
+ let arg = { on: Spoofable, plus: [ definition ] };
65
+
66
+ target.spoof(arg);
67
+
68
+ let spoofed = Spoofable.prototype.spoofNumber;
69
+ let actual = spoofed();
70
+
71
+ target.unspoof();
72
+
73
+ let comparison = comparer.compare(actual, 17);
74
+ expect(comparison).to.be.true;
75
+ });
76
+
77
+ it("Should set class method to return a known string when given args which define that.", /* good */ () => {
78
+ let target = new SpoofClassMethodsFixture();
79
+ let definition = { of: "spoofText", as: "return-text" };
80
+ let arg = { on: Spoofable, plus: [ definition ] };
81
+
82
+ target.spoof(arg);
83
+
84
+ let spoofed = Spoofable.prototype.spoofText;
85
+ let actual = spoofed();
86
+
87
+ target.unspoof();
88
+
89
+ let comparison = comparer.compare(actual, "return-text");
90
+ expect(comparison).to.be.true;
91
+ });
92
+
93
+ it("Should set class method to return a known object when given args which define that.", /* good */ () => {
94
+ let target = new SpoofClassMethodsFixture();
95
+ let definition = { of: "spoofText", as: { first: "one", second: "two" } };
96
+ let arg = { on: Spoofable, plus: [ definition ] };
97
+
98
+ target.spoof(arg);
99
+
100
+ let spoofed = Spoofable.prototype.spoofText;
101
+ let actual = spoofed();
102
+
103
+ target.unspoof();
104
+
105
+ let comparison = comparer.compare(actual, { first: "one", second: "two" });
106
+ expect(comparison).to.be.true;
107
+ });
108
+
109
+ it("Should set class method to return a deep spoofed object when given args which define that.", /* good */ () => {
110
+ let target = new SpoofClassMethodsFixture();
111
+ let definition = { of: "spoofNumber", as: [ { of: "these.those.the.other", as: 76 } ] };
112
+ let arg = { on: Spoofable, plus: [ definition ] };
113
+
114
+ target.spoof(arg);
115
+
116
+ let spoofed = Spoofable.prototype.spoofNumber;
117
+ let actual = spoofed();
118
+
119
+ target.unspoof();
120
+
121
+ let expected = { these: { those: { the: { other: () => { return spoofOutput; } } } } };
122
+
123
+ let comparison = comparer.compare(actual, expected);
124
+ expect(comparison).to.be.true;
125
+
126
+ });
127
+ });
128
+ });
129
+ });
130
+
@@ -0,0 +1,95 @@
1
+ /**/
2
+
3
+ import { SpoofObjectMethodsFixture } from "../../system/SpoofObjectMethodsFixture.js";
4
+ import { TotalComparer } from "../../system/TotalComparer.js";
5
+
6
+ import { expect } from "chai";
7
+
8
+ describe("SpoofObjectMethodsFixture", () => {
9
+ let comparer = new TotalComparer();
10
+
11
+ describe("Direct tests: Definition of spoofed method is compared.", () => {
12
+ it("Should set an empty method property when given args which define that.", /* good */ () => {
13
+ let target = new SpoofObjectMethodsFixture();
14
+ let definition = { of: "spoofNumber" };
15
+ let arg = { with: [ definition ], in: [ ] };
16
+
17
+ target.spoof(arg);
18
+
19
+ let actual = arg.with[0];
20
+
21
+ let comparison = comparer.compare(actual, { spoofNumber: () => { } });
22
+ expect(comparison).to.be.true;
23
+ });
24
+
25
+ it("Should set a method to a known nonce function when given that nonce as an arg.", /* good */ () => {
26
+ let target = new SpoofObjectMethodsFixture();
27
+ let definition = { of: "spoofNumber", as: (a, b) => { return b - a; } };
28
+ let arg = { with: [ definition ], in: [ ] };
29
+
30
+ target.spoof(arg);
31
+
32
+ let actual = arg.with[0];
33
+
34
+ let comparison = comparer.compare(actual, { spoofNumber: (a, b) => { return b - a; } });
35
+ expect(comparison).to.be.true;
36
+ });
37
+
38
+ it("Should set class method to a simple function returning a named parameter when given args which define that.", /* good */ () => {
39
+ let target = new SpoofObjectMethodsFixture();
40
+ let definition = { of: "spoofNumber" , as: 32 };
41
+ let arg = { with: [ definition ], in: [ ] };
42
+
43
+ target.spoof(arg);
44
+
45
+ let actual = arg.with[0];
46
+
47
+ let comparison = comparer.compare(actual, { spoofNumber: () => { return spoofOutput; } });
48
+ expect(comparison).to.be.true;
49
+ });
50
+ })
51
+
52
+ describe("Indirect tests: Result of calling spoofed method is compared.", () => {
53
+ it("Should set a method to return a known value when given args which define that.", /* good */ () => {
54
+ let target = new SpoofObjectMethodsFixture();
55
+ let definition = { of: "spoofNumber", as: 17 };
56
+ let arg = { with: [ definition ], in: [] };
57
+
58
+ target.spoof(arg);
59
+
60
+ let spoofed = arg.with[0];
61
+ let actual = spoofed.spoofNumber();
62
+
63
+ let comparison = comparer.compare(actual, 17);
64
+ expect(comparison).to.be.true;
65
+ });
66
+
67
+ it("Should set a method to return a known string when given args which define that.", /* good */ () => {
68
+ let target = new SpoofObjectMethodsFixture();
69
+ let definition = { of: "spoofText", as: "return-text" };
70
+ let arg = { with: [ definition ], in: [] };
71
+
72
+ target.spoof(arg);
73
+
74
+ let spoofed = arg.with[0];
75
+ let actual = spoofed.spoofText();
76
+
77
+ let comparison = comparer.compare(actual, "return-text");
78
+ expect(comparison).to.be.true;
79
+ });
80
+
81
+ it("Should set a method to return a known object when given args which define that.", /* good */ () => {
82
+ let target = new SpoofObjectMethodsFixture();
83
+ let definition = { of: "spoofText", as: { first: "one", second: "two" } };
84
+ let arg = { with: [ definition ], in: [] };
85
+
86
+ target.spoof(arg);
87
+
88
+ let spoofed = arg.with[0];
89
+ let actual = spoofed.spoofText();
90
+
91
+ let comparison = comparer.compare(actual, { first: "one", second: "two" });
92
+ expect(comparison).to.be.true;
93
+ });
94
+ });
95
+ });
@@ -0,0 +1,93 @@
1
+ /**/
2
+
3
+ import { SpoofTuple } from "../../system/SpoofTuple.js";
4
+ import { expect } from "chai";
5
+
6
+ describe("SpoofTuple", () => {
7
+ /* Some cases here are effectively impossible to test directly in self-tests, at least
8
+ without complicated workarounds, because of how SpoofTuple is used by Kitten tests. */
9
+
10
+ describe("isNotASpoof()", () => {
11
+ it("Should return true when arg is undefined.", /* good */ () => {
12
+ let nonce = undefined;
13
+
14
+ let actual = SpoofTuple.isNotASpoof(nonce);
15
+
16
+ expect(actual).to.be.true;
17
+ });
18
+
19
+ it("Should return true when arg is null.", /* good */ () => {
20
+ let nonce = null;
21
+
22
+ let actual = SpoofTuple.isNotASpoof(nonce);
23
+
24
+ expect(actual).to.be.true;
25
+ });
26
+
27
+ it("Should return true when arg is a string.", /* good */ () => {
28
+ let nonce = "text";
29
+
30
+ let actual = SpoofTuple.isNotASpoof(nonce);
31
+
32
+ expect(actual).to.be.true;
33
+ });
34
+
35
+ it("Should return true when arg is a value, such as a number.", /* good */ () => {
36
+ let nonce = 37;
37
+
38
+ let actual = SpoofTuple.isNotASpoof(nonce);
39
+
40
+ expect(actual).to.be.true;
41
+ });
42
+
43
+ it("Should return true when arg is a predefined JavaScript Object, such as a Map.", /* good */ () => {
44
+ let nonce = new Map();
45
+
46
+ let actual = SpoofTuple.isNotASpoof(nonce);
47
+
48
+ expect(actual).to.be.true;
49
+ });
50
+
51
+ it("Should return true when arg contains SpoofTuple properties but also .not.", /* good */ () => {
52
+ let nonce = { on: "on-arg", of: "of-arg", as: "as-arg", not: true };
53
+
54
+ let actual = SpoofTuple.isNotASpoof(nonce);
55
+
56
+ expect(actual).to.be.true;
57
+ });
58
+
59
+ it("Should return true when arg contains SpoofTuple properties but also .skip.", /* good */ () => {
60
+ let nonce = { on: "on-arg", of: "of-arg", as: "as-arg", skip: true };
61
+
62
+ let actual = SpoofTuple.isNotASpoof(nonce);
63
+
64
+ expect(actual).to.be.true;
65
+ });
66
+
67
+ it("Should return true when arg doesn't contain any SpoofTuple properties.", /* good */ () => {
68
+ let nonce = { notOn: true, notOf: "true", notAs: "not-as" };
69
+
70
+ let actual = SpoofTuple.isNotASpoof(nonce);
71
+
72
+ expect(actual).to.be.true;
73
+ });
74
+
75
+ it("Should return false when arg contains any short-named " +
76
+ "SpoofTuple property, but neither .not nor .skip.", /* good */ () => {
77
+ let nonce = { on: "some-class" };
78
+
79
+ let actual = SpoofTuple.isNotASpoof(nonce);
80
+
81
+ expect(actual).to.be.false;
82
+ });
83
+
84
+ it("Should return false when arg contains any long-named " +
85
+ "SpoofTuple property, but neither .not nor .skip.", /* good */ () => {
86
+ let nonce = { method: "some-method" };
87
+
88
+ let actual = SpoofTuple.isNotASpoof(nonce);
89
+
90
+ expect(actual).to.be.false;
91
+ });
92
+ });
93
+ });