@genesislcap/foundation-testing 14.408.0 → 14.409.0
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 +5 -278
- package/package.json +5 -6
- package/docs/api/foundation-testing.componentcontext.container.md +0 -11
- package/docs/api/foundation-testing.componentcontext.designsystem.md +0 -11
- package/docs/api/foundation-testing.componentcontext.md +0 -91
- package/docs/api/foundation-testing.componentcontext.runcases.md +0 -11
- package/docs/api/foundation-testing.createcomponentsuite.md +0 -168
- package/docs/api/foundation-testing.createlogicsuite.md +0 -99
- package/docs/api/foundation-testing.delayedresolve.md +0 -80
- package/docs/api/foundation-testing.elementgetter.md +0 -12
- package/docs/api/foundation-testing.equal.md +0 -13
- package/docs/api/foundation-testing.expect.md +0 -13
- package/docs/api/foundation-testing.filterconditionally.md +0 -15
- package/docs/api/foundation-testing.fixture.connect.md +0 -21
- package/docs/api/foundation-testing.fixture.disconnect.md +0 -21
- package/docs/api/foundation-testing.fixture.document.md +0 -13
- package/docs/api/foundation-testing.fixture.element.md +0 -13
- package/docs/api/foundation-testing.fixture.md +0 -171
- package/docs/api/foundation-testing.fixture.parent.md +0 -18
- package/docs/api/foundation-testing.fixture.template.md +0 -13
- package/docs/api/foundation-testing.fixture.view.md +0 -13
- package/docs/api/foundation-testing.fixtureoptions.context.md +0 -13
- package/docs/api/foundation-testing.fixtureoptions.designsystem.md +0 -13
- package/docs/api/foundation-testing.fixtureoptions.document.md +0 -13
- package/docs/api/foundation-testing.fixtureoptions.md +0 -134
- package/docs/api/foundation-testing.fixtureoptions.parent.md +0 -13
- package/docs/api/foundation-testing.fixtureoptions.source.md +0 -13
- package/docs/api/foundation-testing.logger.md +0 -18
- package/docs/api/foundation-testing.logiccontext.md +0 -40
- package/docs/api/foundation-testing.logiccontext.runcases.md +0 -64
- package/docs/api/foundation-testing.md +0 -317
- package/docs/api/foundation-testing.resettestharness.md +0 -54
- package/docs/api/foundation-testing.restoretestharness.md +0 -54
- package/docs/api/foundation-testing.runcases.md +0 -12
- package/docs/api/foundation-testing.sinonwrapper.md +0 -17
- package/docs/api/foundation-testing.spiedfunctions.md +0 -15
- package/docs/api/foundation-testing.suitecallback.md +0 -15
- package/docs/api/foundation-testing.testspy.md +0 -66
- package/docs/api/foundation-testing.timeout.md +0 -99
- package/docs/api/foundation-testing.withtestharness.md +0 -17
- package/docs/api/index.md +0 -30
- package/docs/api-report.md.api.md +0 -143
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [FixtureOptions](./foundation-testing.fixtureoptions.md) > [parent](./foundation-testing.fixtureoptions.parent.md)
|
|
4
|
-
|
|
5
|
-
## FixtureOptions.parent property
|
|
6
|
-
|
|
7
|
-
The parent element to append the fixture to.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
parent?: HTMLElement;
|
|
13
|
-
```
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [FixtureOptions](./foundation-testing.fixtureoptions.md) > [source](./foundation-testing.fixtureoptions.source.md)
|
|
4
|
-
|
|
5
|
-
## FixtureOptions.source property
|
|
6
|
-
|
|
7
|
-
The data source to bind the HTML to.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
source?: any;
|
|
13
|
-
```
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [logger](./foundation-testing.logger.md)
|
|
4
|
-
|
|
5
|
-
## logger variable
|
|
6
|
-
|
|
7
|
-
Test logger
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
logger: import("@genesislcap/foundation-logger").Logger
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Remarks
|
|
16
|
-
|
|
17
|
-
Exported so you can set log levels differently across packages when needed.
|
|
18
|
-
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [LogicContext](./foundation-testing.logiccontext.md)
|
|
4
|
-
|
|
5
|
-
## LogicContext interface
|
|
6
|
-
|
|
7
|
-
Logic suite context interface
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export interface LogicContext
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Methods
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Method
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Description
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th></tr></thead>
|
|
28
|
-
<tbody><tr><td>
|
|
29
|
-
|
|
30
|
-
[runCases(fn, cases)?](./foundation-testing.logiccontext.runcases.md)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
</td><td>
|
|
34
|
-
|
|
35
|
-
_(Optional)_
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td></tr>
|
|
39
|
-
</tbody></table>
|
|
40
|
-
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [LogicContext](./foundation-testing.logiccontext.md) > [runCases](./foundation-testing.logiccontext.runcases.md)
|
|
4
|
-
|
|
5
|
-
## LogicContext.runCases() method
|
|
6
|
-
|
|
7
|
-
**Signature:**
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
runCases?(fn: (value: any) => any, cases: [any, any, assert.Message?][]): void;
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Parameters
|
|
14
|
-
|
|
15
|
-
<table><thead><tr><th>
|
|
16
|
-
|
|
17
|
-
Parameter
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</th><th>
|
|
21
|
-
|
|
22
|
-
Type
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</th><th>
|
|
26
|
-
|
|
27
|
-
Description
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</th></tr></thead>
|
|
31
|
-
<tbody><tr><td>
|
|
32
|
-
|
|
33
|
-
fn
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</td><td>
|
|
37
|
-
|
|
38
|
-
(value: any) => any
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</td><td>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</td></tr>
|
|
45
|
-
<tr><td>
|
|
46
|
-
|
|
47
|
-
cases
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</td><td>
|
|
51
|
-
|
|
52
|
-
\[any, any, assert.Message?\]\[\]
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</td><td>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</td></tr>
|
|
59
|
-
</tbody></table>
|
|
60
|
-
|
|
61
|
-
**Returns:**
|
|
62
|
-
|
|
63
|
-
void
|
|
64
|
-
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md)
|
|
4
|
-
|
|
5
|
-
## foundation-testing package
|
|
6
|
-
|
|
7
|
-
## Functions
|
|
8
|
-
|
|
9
|
-
<table><thead><tr><th>
|
|
10
|
-
|
|
11
|
-
Function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</th><th>
|
|
15
|
-
|
|
16
|
-
Description
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</th></tr></thead>
|
|
20
|
-
<tbody><tr><td>
|
|
21
|
-
|
|
22
|
-
[createComponentSuite(title, elementNameOrGetter, context, registrations)](./foundation-testing.createcomponentsuite.md)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</td><td>
|
|
26
|
-
|
|
27
|
-
Create component test suite.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</td></tr>
|
|
31
|
-
<tr><td>
|
|
32
|
-
|
|
33
|
-
[createLogicSuite(title, context)](./foundation-testing.createlogicsuite.md)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</td><td>
|
|
37
|
-
|
|
38
|
-
Create logic test suite.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</td></tr>
|
|
42
|
-
<tr><td>
|
|
43
|
-
|
|
44
|
-
[delayedResolve(result, duration)](./foundation-testing.delayedresolve.md)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
</td><td>
|
|
48
|
-
|
|
49
|
-
Delayed resolve utility.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</td></tr>
|
|
53
|
-
<tr><td>
|
|
54
|
-
|
|
55
|
-
[fixture(templateNameOrRegistry, options)](./foundation-testing.fixture.md)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</td><td>
|
|
59
|
-
|
|
60
|
-
Creates a test fixture suitable for testing custom elements, templates, and bindings.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</td></tr>
|
|
64
|
-
<tr><td>
|
|
65
|
-
|
|
66
|
-
[resetTestHarness(wrapper)](./foundation-testing.resettestharness.md)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</td><td>
|
|
70
|
-
|
|
71
|
-
Resets the history of the spied functions on the objects so previous running tests don't affect the current test. Must be called at the end of every test even if not asserting on the spies.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
</td></tr>
|
|
75
|
-
<tr><td>
|
|
76
|
-
|
|
77
|
-
[restoreTestHarness(wrapper)](./foundation-testing.restoretestharness.md)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</td><td>
|
|
81
|
-
|
|
82
|
-
Restores the spied functions back to the original functions without the spies.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
</td></tr>
|
|
86
|
-
<tr><td>
|
|
87
|
-
|
|
88
|
-
[runCases(fn, cases, assertion)](./foundation-testing.runcases.md)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</td><td>
|
|
92
|
-
|
|
93
|
-
Assert a set of test cases.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</td></tr>
|
|
97
|
-
<tr><td>
|
|
98
|
-
|
|
99
|
-
[testSpy(constructor)](./foundation-testing.testspy.md)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</td><td>
|
|
103
|
-
|
|
104
|
-
Decorator: Used on a test harness class based on a `FoundationElement` to give it extra functionality which can be used during testing. \*Important\* this is to be used on a parent element compared to the element under test.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
</td></tr>
|
|
108
|
-
<tr><td>
|
|
109
|
-
|
|
110
|
-
[timeout(callback, duration)](./foundation-testing.timeout.md)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
</td><td>
|
|
114
|
-
|
|
115
|
-
Timeout utility.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
</td></tr>
|
|
119
|
-
</tbody></table>
|
|
120
|
-
|
|
121
|
-
## Interfaces
|
|
122
|
-
|
|
123
|
-
<table><thead><tr><th>
|
|
124
|
-
|
|
125
|
-
Interface
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</th><th>
|
|
129
|
-
|
|
130
|
-
Description
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
</th></tr></thead>
|
|
134
|
-
<tbody><tr><td>
|
|
135
|
-
|
|
136
|
-
[ComponentContext](./foundation-testing.componentcontext.md)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</td><td>
|
|
140
|
-
|
|
141
|
-
Component suite context interface
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
</td></tr>
|
|
145
|
-
<tr><td>
|
|
146
|
-
|
|
147
|
-
[Fixture](./foundation-testing.fixture.md)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</td><td>
|
|
151
|
-
|
|
152
|
-
Unit test fixture.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
</td></tr>
|
|
156
|
-
<tr><td>
|
|
157
|
-
|
|
158
|
-
[FixtureOptions](./foundation-testing.fixtureoptions.md)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
</td><td>
|
|
162
|
-
|
|
163
|
-
Options used to customize the creation of the unit test fixture.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
</td></tr>
|
|
167
|
-
<tr><td>
|
|
168
|
-
|
|
169
|
-
[LogicContext](./foundation-testing.logiccontext.md)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
</td><td>
|
|
173
|
-
|
|
174
|
-
Logic suite context interface
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
</td></tr>
|
|
178
|
-
</tbody></table>
|
|
179
|
-
|
|
180
|
-
## Variables
|
|
181
|
-
|
|
182
|
-
<table><thead><tr><th>
|
|
183
|
-
|
|
184
|
-
Variable
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
</th><th>
|
|
188
|
-
|
|
189
|
-
Description
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
</th></tr></thead>
|
|
193
|
-
<tbody><tr><td>
|
|
194
|
-
|
|
195
|
-
[logger](./foundation-testing.logger.md)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</td><td>
|
|
199
|
-
|
|
200
|
-
Test logger
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
</td></tr>
|
|
204
|
-
</tbody></table>
|
|
205
|
-
|
|
206
|
-
## Type Aliases
|
|
207
|
-
|
|
208
|
-
<table><thead><tr><th>
|
|
209
|
-
|
|
210
|
-
Type Alias
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
</th><th>
|
|
214
|
-
|
|
215
|
-
Description
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
</th></tr></thead>
|
|
219
|
-
<tbody><tr><td>
|
|
220
|
-
|
|
221
|
-
[ElementGetter](./foundation-testing.elementgetter.md)
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
</td><td>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
</td></tr>
|
|
229
|
-
<tr><td>
|
|
230
|
-
|
|
231
|
-
[Equal](./foundation-testing.equal.md)
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
</td><td>
|
|
235
|
-
|
|
236
|
-
Expects that the type parameter X is equal to Y, returning true or false
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
</td></tr>
|
|
240
|
-
<tr><td>
|
|
241
|
-
|
|
242
|
-
[Expect](./foundation-testing.expect.md)
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
</td><td>
|
|
246
|
-
|
|
247
|
-
Expects that the type parameter T resolves to true, or will be a typescript error
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</td></tr>
|
|
251
|
-
<tr><td>
|
|
252
|
-
|
|
253
|
-
[FilterConditionally](./foundation-testing.filterconditionally.md)
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
</td><td>
|
|
257
|
-
|
|
258
|
-
Filters out key/value pairs from an object where they value does not match a condition
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
</td></tr>
|
|
262
|
-
<tr><td>
|
|
263
|
-
|
|
264
|
-
[RunCases](./foundation-testing.runcases.md)
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
</td><td>
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
</td></tr>
|
|
272
|
-
<tr><td>
|
|
273
|
-
|
|
274
|
-
[SinonWrapper](./foundation-testing.sinonwrapper.md)
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
</td><td>
|
|
278
|
-
|
|
279
|
-
Crates an object with a key value pair for each spied function where the key is the function name and the value is the sinon wrapped spy function
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
</td></tr>
|
|
283
|
-
<tr><td>
|
|
284
|
-
|
|
285
|
-
[SpiedFunctions](./foundation-testing.spiedfunctions.md)
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
</td><td>
|
|
289
|
-
|
|
290
|
-
Filters out all key/value pairs which are not functions, and omits the constructor
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
</td></tr>
|
|
294
|
-
<tr><td>
|
|
295
|
-
|
|
296
|
-
[SuiteCallback](./foundation-testing.suitecallback.md)
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
</td><td>
|
|
300
|
-
|
|
301
|
-
Defines the Generic type for a test Suite `T` the callback function required to assert on type `T`<!-- -->.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
</td></tr>
|
|
305
|
-
<tr><td>
|
|
306
|
-
|
|
307
|
-
[WithTestHarness](./foundation-testing.withtestharness.md)
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
</td><td>
|
|
311
|
-
|
|
312
|
-
Type can be used to inform Typescript the object decorated with [testSpy()](./foundation-testing.testspy.md) has function spies which can be interacted upon their normal function reference
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
</td></tr>
|
|
316
|
-
</tbody></table>
|
|
317
|
-
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [resetTestHarness](./foundation-testing.resettestharness.md)
|
|
4
|
-
|
|
5
|
-
## resetTestHarness() function
|
|
6
|
-
|
|
7
|
-
Resets the history of the spied functions on the objects so previous running tests don't affect the current test. Must be called at the end of every test even if not asserting on the spies.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function resetTestHarness<T>(wrapper: WithTestHarness<T>): void;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
wrapper
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
[WithTestHarness](./foundation-testing.withtestharness.md)<!-- --><T>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
`WithTestHarness<T>` object to reset
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
|
|
51
|
-
**Returns:**
|
|
52
|
-
|
|
53
|
-
void
|
|
54
|
-
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [restoreTestHarness](./foundation-testing.restoretestharness.md)
|
|
4
|
-
|
|
5
|
-
## restoreTestHarness() function
|
|
6
|
-
|
|
7
|
-
Restores the spied functions back to the original functions without the spies.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function restoreTestHarness<T>(wrapper: WithTestHarness<T>): void;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
wrapper
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
[WithTestHarness](./foundation-testing.withtestharness.md)<!-- --><T>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
`WithTestHarness<T>` object to restore
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
|
|
51
|
-
**Returns:**
|
|
52
|
-
|
|
53
|
-
void
|
|
54
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [RunCases](./foundation-testing.runcases.md)
|
|
4
|
-
|
|
5
|
-
## RunCases type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
**Signature:**
|
|
9
|
-
|
|
10
|
-
```typescript
|
|
11
|
-
export type RunCases = (fn: (...args: unknown[]) => unknown, cases: [unknown[], unknown, string?][], assertion?: (...args: unknown[]) => void) => void;
|
|
12
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [SinonWrapper](./foundation-testing.sinonwrapper.md)
|
|
4
|
-
|
|
5
|
-
## SinonWrapper type
|
|
6
|
-
|
|
7
|
-
Crates an object with a key value pair for each spied function where the key is the function name and the value is the sinon wrapped spy function
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export type SinonWrapper<T extends {
|
|
13
|
-
[K in keyof T]: (...args: any) => any;
|
|
14
|
-
}> = {
|
|
15
|
-
[K in keyof T]: sinon.SinonSpy<Parameters<T[K]>, ReturnType<T[K]>>;
|
|
16
|
-
};
|
|
17
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [SpiedFunctions](./foundation-testing.spiedfunctions.md)
|
|
4
|
-
|
|
5
|
-
## SpiedFunctions type
|
|
6
|
-
|
|
7
|
-
Filters out all key/value pairs which are not functions, and omits the constructor
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export type SpiedFunctions<T> = Omit<FilterConditionally<T, (...args: any[]) => any>, 'constructor'>;
|
|
13
|
-
```
|
|
14
|
-
**References:** [FilterConditionally](./foundation-testing.filterconditionally.md)
|
|
15
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [SuiteCallback](./foundation-testing.suitecallback.md)
|
|
4
|
-
|
|
5
|
-
## SuiteCallback type
|
|
6
|
-
|
|
7
|
-
Defines the Generic type for a test Suite `T` the callback function required to assert on type `T`<!-- -->.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export type SuiteCallback<T> = uvu.Callback<ComponentContext<T>>;
|
|
13
|
-
```
|
|
14
|
-
**References:** [ComponentContext](./foundation-testing.componentcontext.md)
|
|
15
|
-
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [testSpy](./foundation-testing.testspy.md)
|
|
4
|
-
|
|
5
|
-
## testSpy() function
|
|
6
|
-
|
|
7
|
-
Decorator: Used on a test harness class based on a `FoundationElement` to give it extra functionality which can be used during testing. \*Important\* this is to be used on a parent element compared to the element under test.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare function testSpy(constructor: Function): void;
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
<table><thead><tr><th>
|
|
18
|
-
|
|
19
|
-
Parameter
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Description
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th></tr></thead>
|
|
33
|
-
<tbody><tr><td>
|
|
34
|
-
|
|
35
|
-
constructor
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
Function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</td></tr>
|
|
47
|
-
</tbody></table>
|
|
48
|
-
|
|
49
|
-
**Returns:**
|
|
50
|
-
|
|
51
|
-
void
|
|
52
|
-
|
|
53
|
-
## Remarks
|
|
54
|
-
|
|
55
|
-
Access the test functionality using the type with [WithTestHarness](./foundation-testing.withtestharness.md)
|
|
56
|
-
|
|
57
|
-
Reset after each test with [resetTestHarness()](./foundation-testing.resettestharness.md)
|
|
58
|
-
|
|
59
|
-
## Example
|
|
60
|
-
|
|
61
|
-
// Testing the first function call async (<!-- -->{ element }<!-- -->) =<!-- -->> {
|
|
62
|
-
|
|
63
|
-
assert.ok( element.layout.addItemFromChild.calledWith(<!-- -->{ type: 'component', componentType: 'test', title: `Item test`<!-- -->, reorderEnabled: true, isClosable: false, size: undefined, }<!-- -->) );
|
|
64
|
-
|
|
65
|
-
// Reset the tester at the end of every test even if you don't assert on any of it! resetTestHarness(element.layout); }
|
|
66
|
-
|