risei 1.1.1 → 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.
Files changed (42) hide show
  1. package/README.md +3 -1
  2. package/index.js +1 -1
  3. package/package.json +4 -4
  4. package/tests/other-tests/ASpoofingFixture.tests.js +0 -242
  5. package/tests/other-tests/SpoofClassesFixture.tests.js +0 -130
  6. package/tests/other-tests/SpoofObjectsFixture.tests.js +0 -95
  7. package/tests/other-tests/SpoofTuple.tests.js +0 -93
  8. package/tests/other-tests/TotalComparer.tests.js +0 -920
  9. package/tests/other-tests/package.json +0 -7
  10. package/tests/risei-tests/ASpoofingFixtureTests.rt.js +0 -51
  11. package/tests/risei-tests/MomentTests.rt.js +0 -103
  12. package/tests/risei-tests/SpoofTupleTests.rt.js +0 -274
  13. package/tests/risei-tests/TestFrameChooserTests.rt.js +0 -74
  14. package/tests/risei-tests/TestFrameTests.rt.js +0 -84
  15. package/tests/risei-tests/TestStagesTests.rt.js +0 -99
  16. package/tests/risei-tests/TestTupleTests.rt.js +0 -140
  17. package/tests/risei-tests/TotalComparerTests.rt.js +0 -184
  18. package/tests/risei-tests/TotalCopierTests.rt.js +0 -74
  19. package/tests/risei-tests/TotalDisplayerTests.rt.js +0 -186
  20. package/tests/risei-tests/TypeAnalyzerTests.rt.js +0 -29
  21. package/tests/risei-tests/TypeIdentifierTests.rt.js +0 -44
  22. package/tests/self-tests/SelfTests.outward-rt.js +0 -583
  23. package/tests/target-objects/CompositionModel.js +0 -38
  24. package/tests/target-objects/ConditionalThrowModel.js +0 -11
  25. package/tests/target-objects/CountModel.js +0 -46
  26. package/tests/target-objects/DomModel.js +0 -37
  27. package/tests/target-objects/MixedContents.js +0 -33
  28. package/tests/target-objects/MutationModel.js +0 -27
  29. package/tests/target-objects/ObjectCompositionModel.js +0 -34
  30. package/tests/target-objects/PolySpoofableInner.js +0 -30
  31. package/tests/target-objects/PolySpoofableOuter.js +0 -52
  32. package/tests/target-objects/PropertiesModel.js +0 -47
  33. package/tests/target-objects/Returner.js +0 -9
  34. package/tests/target-objects/SearchModel.js +0 -25
  35. package/tests/target-objects/SortModel.js +0 -91
  36. package/tests/target-objects/SpoofCaller.js +0 -24
  37. package/tests/target-objects/Spoofable.js +0 -36
  38. package/tests/target-objects/SpoofableArgsCaller.js +0 -33
  39. package/tests/target-objects/StateModel.js +0 -34
  40. package/tests/target-objects/StaticModel.js +0 -17
  41. package/tests/target-objects/TestableModel.js +0 -47
  42. package/tests/topic-tests/TopicTests.outward-rt.js +0 -354
package/README.md CHANGED
@@ -507,13 +507,15 @@ One known unexpected result (not quite a bug) exists:
507
507
 
508
508
  ## What's new in Risei
509
509
 
510
- Release **1.1.1** of Risei (January, 2024) fixes two problems:
510
+ Release **1.1.2** of Risei (January, 2024) fixes two problems:
511
511
  - Classes were sometimes displayed in output as their entire definition, instead of just the class name.
512
512
  - All `Date` instances were considered equal, regardless of their actual value.
513
513
 
514
514
  Development of Risei is ongoing, including internal improvements, problem fixes, and additional options for testing.
515
515
 
516
516
 
517
+ > Do not use release **1.1.1**, because it contains an internal path error.
518
+
517
519
 
518
520
 
519
521
  ## Who makes Risei
package/index.js CHANGED
@@ -66,7 +66,7 @@ let wide = (text) => {
66
66
  async function runRiseiTests(testFinderPath) {
67
67
  // region Converting test-finder from path to class
68
68
 
69
- testFinderPath = testFinderPath || "./public/javascript/TestFinder.js";
69
+ testFinderPath = testFinderPath || "./system/TestFinder.js";
70
70
  let finderModule = await import(testFinderPath);
71
71
 
72
72
  let moduleKeys = Object.keys(finderModule);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "risei",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Risei is the framework that allows you to write unit tests as collections of values in JavaScript objects, so it's easy and fast, and tests don't serve as a drag on redesigns.",
5
5
  "keywords": [
6
6
  "unit test",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "exports": {
34
34
  ".": "./index.js",
35
- "./ATestSource": "./public/javascript/ATestSource.js"
35
+ "./ATestSource": "./system/ATestSource.js"
36
36
  },
37
37
  "dependencies": {
38
38
  "chalk": "^5.0.0",
@@ -44,10 +44,10 @@
44
44
  "chalk": "^5.0.0",
45
45
  "cookie-parser": "~1.4.4",
46
46
  "debug": "~2.6.9",
47
- "express": "~4.16.1",
47
+ "express": "^4.18.2",
48
48
  "fs": "^0.0.1-security",
49
49
  "mocha": "^10.0.0",
50
50
  "morgan": "~1.9.1",
51
- "risei": "^1.1.0"
51
+ "risei": "1.1.2"
52
52
  }
53
53
  }
@@ -1,242 +0,0 @@
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
- });
@@ -1,130 +0,0 @@
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
-
@@ -1,95 +0,0 @@
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
- });
@@ -1,93 +0,0 @@
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
- });