@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.
Files changed (42) hide show
  1. package/README.md +5 -278
  2. package/package.json +5 -6
  3. package/docs/api/foundation-testing.componentcontext.container.md +0 -11
  4. package/docs/api/foundation-testing.componentcontext.designsystem.md +0 -11
  5. package/docs/api/foundation-testing.componentcontext.md +0 -91
  6. package/docs/api/foundation-testing.componentcontext.runcases.md +0 -11
  7. package/docs/api/foundation-testing.createcomponentsuite.md +0 -168
  8. package/docs/api/foundation-testing.createlogicsuite.md +0 -99
  9. package/docs/api/foundation-testing.delayedresolve.md +0 -80
  10. package/docs/api/foundation-testing.elementgetter.md +0 -12
  11. package/docs/api/foundation-testing.equal.md +0 -13
  12. package/docs/api/foundation-testing.expect.md +0 -13
  13. package/docs/api/foundation-testing.filterconditionally.md +0 -15
  14. package/docs/api/foundation-testing.fixture.connect.md +0 -21
  15. package/docs/api/foundation-testing.fixture.disconnect.md +0 -21
  16. package/docs/api/foundation-testing.fixture.document.md +0 -13
  17. package/docs/api/foundation-testing.fixture.element.md +0 -13
  18. package/docs/api/foundation-testing.fixture.md +0 -171
  19. package/docs/api/foundation-testing.fixture.parent.md +0 -18
  20. package/docs/api/foundation-testing.fixture.template.md +0 -13
  21. package/docs/api/foundation-testing.fixture.view.md +0 -13
  22. package/docs/api/foundation-testing.fixtureoptions.context.md +0 -13
  23. package/docs/api/foundation-testing.fixtureoptions.designsystem.md +0 -13
  24. package/docs/api/foundation-testing.fixtureoptions.document.md +0 -13
  25. package/docs/api/foundation-testing.fixtureoptions.md +0 -134
  26. package/docs/api/foundation-testing.fixtureoptions.parent.md +0 -13
  27. package/docs/api/foundation-testing.fixtureoptions.source.md +0 -13
  28. package/docs/api/foundation-testing.logger.md +0 -18
  29. package/docs/api/foundation-testing.logiccontext.md +0 -40
  30. package/docs/api/foundation-testing.logiccontext.runcases.md +0 -64
  31. package/docs/api/foundation-testing.md +0 -317
  32. package/docs/api/foundation-testing.resettestharness.md +0 -54
  33. package/docs/api/foundation-testing.restoretestharness.md +0 -54
  34. package/docs/api/foundation-testing.runcases.md +0 -12
  35. package/docs/api/foundation-testing.sinonwrapper.md +0 -17
  36. package/docs/api/foundation-testing.spiedfunctions.md +0 -15
  37. package/docs/api/foundation-testing.suitecallback.md +0 -15
  38. package/docs/api/foundation-testing.testspy.md +0 -66
  39. package/docs/api/foundation-testing.timeout.md +0 -99
  40. package/docs/api/foundation-testing.withtestharness.md +0 -17
  41. package/docs/api/index.md +0 -30
  42. package/docs/api-report.md.api.md +0 -143
@@ -1,99 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [createLogicSuite](./foundation-testing.createlogicsuite.md)
4
-
5
- ## createLogicSuite() function
6
-
7
- Create logic test suite.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- export declare function createLogicSuite<TContext = LogicContext>(title: string, context?: TContext): uvu.Test<TContext>;
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
- title
36
-
37
-
38
- </td><td>
39
-
40
- string
41
-
42
-
43
- </td><td>
44
-
45
- Title of the test suite
46
-
47
-
48
- </td></tr>
49
- <tr><td>
50
-
51
- context
52
-
53
-
54
- </td><td>
55
-
56
- TContext
57
-
58
-
59
- </td><td>
60
-
61
- _(Optional)_ Optional context which extends [LogicContext](./foundation-testing.logiccontext.md)
62
-
63
-
64
- </td></tr>
65
- </tbody></table>
66
-
67
- **Returns:**
68
-
69
- uvu.Test&lt;TContext&gt;
70
-
71
- The test suite
72
-
73
- ## Remarks
74
-
75
- Used to test function output given certain input arguments.
76
-
77
- ## Example
78
-
79
-
80
- ```ts
81
- import { createLogicSuite } from '@genesislcap/foundation-testing';
82
- import { myFunction } from './logic';
83
- const Suite = createLogicSuite('myFunction');
84
- Suite('myFunction should provide expected results', ({ runCases }) => {
85
- runCases(myFunction, [
86
- [['1'], true],
87
- [[123], true],
88
- [['60%'], true],
89
- [['$60'], false],
90
- [['1.1'], false],
91
- [[''], false],
92
- [[true], false],
93
- [[null], false],
94
- [[undefined], false],
95
- ]);
96
- });
97
- Suite.run();
98
- ```
99
-
@@ -1,80 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [delayedResolve](./foundation-testing.delayedresolve.md)
4
-
5
- ## delayedResolve() function
6
-
7
- Delayed resolve utility.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- delayedResolve: (result: unknown, duration?: number) => () => Promise<unknown>
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
- result
36
-
37
-
38
- </td><td>
39
-
40
- unknown
41
-
42
-
43
- </td><td>
44
-
45
- The result of the promise.
46
-
47
-
48
- </td></tr>
49
- <tr><td>
50
-
51
- duration
52
-
53
-
54
- </td><td>
55
-
56
- number
57
-
58
-
59
- </td><td>
60
-
61
- _(Optional)_ An optional duration in milliseconds. Defaults to 500.
62
-
63
-
64
- </td></tr>
65
- </tbody></table>
66
-
67
- **Returns:**
68
-
69
- () =&gt; Promise&lt;unknown&gt;
70
-
71
- ## Example
72
-
73
-
74
- ```ts
75
- test('delayed resolve', async () => {
76
- const mockAPI = delayedResolve({ foo: 'bar' }, 2_000);
77
- const result = await mockAPI();
78
- });
79
- ```
80
-
@@ -1,12 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [ElementGetter](./foundation-testing.elementgetter.md)
4
-
5
- ## ElementGetter type
6
-
7
-
8
- **Signature:**
9
-
10
- ```typescript
11
- export type ElementGetter = () => FoundationElementRegistry<FoundationElementDefinition, FoundationElement>;
12
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Equal](./foundation-testing.equal.md)
4
-
5
- ## Equal type
6
-
7
- Expects that the type parameter X is equal to Y, returning true or false
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- export type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Expect](./foundation-testing.expect.md)
4
-
5
- ## Expect type
6
-
7
- Expects that the type parameter T resolves to true, or will be a typescript error
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- export type Expect<T extends true> = T;
13
- ```
@@ -1,15 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [FilterConditionally](./foundation-testing.filterconditionally.md)
4
-
5
- ## FilterConditionally type
6
-
7
- Filters out key/value pairs from an object where they value does not match a condition
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- export type FilterConditionally<Source, Condition> = Pick<Source, {
13
- [K in keyof Source]: Source[K] extends Condition ? K : never;
14
- }[keyof Source]>;
15
- ```
@@ -1,21 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Fixture](./foundation-testing.fixture.md) &gt; [connect](./foundation-testing.fixture.connect.md)
4
-
5
- ## Fixture.connect() method
6
-
7
- Adds the [Fixture.parent](./foundation-testing.fixture.parent.md) to the DOM, causing the connect lifecycle to begin.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- connect(): Promise<void>;
13
- ```
14
- **Returns:**
15
-
16
- Promise&lt;void&gt;
17
-
18
- ## Remarks
19
-
20
- Yields control to the caller one Microtask later, in order to ensure that the DOM has settled.
21
-
@@ -1,21 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Fixture](./foundation-testing.fixture.md) &gt; [disconnect](./foundation-testing.fixture.disconnect.md)
4
-
5
- ## Fixture.disconnect() method
6
-
7
- Removes the [Fixture.parent](./foundation-testing.fixture.parent.md) from the DOM, causing the disconnect lifecycle to begin.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- disconnect(): Promise<void>;
13
- ```
14
- **Returns:**
15
-
16
- Promise&lt;void&gt;
17
-
18
- ## Remarks
19
-
20
- Yields control to the caller one Microtask later, in order to ensure that the DOM has settled.
21
-
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Fixture](./foundation-testing.fixture.md) &gt; [document](./foundation-testing.fixture.document.md)
4
-
5
- ## Fixture.document property
6
-
7
- The document the fixture is running in.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- document: Document;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Fixture](./foundation-testing.fixture.md) &gt; [element](./foundation-testing.fixture.element.md)
4
-
5
- ## Fixture.element property
6
-
7
- The first element in the [Fixture.view](./foundation-testing.fixture.view.md)<!-- -->.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- element: TElement;
13
- ```
@@ -1,171 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Fixture](./foundation-testing.fixture.md)
4
-
5
- ## Fixture interface
6
-
7
- Unit test fixture.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- export interface Fixture<TElement = HTMLElement>
13
- ```
14
-
15
- ## Properties
16
-
17
- <table><thead><tr><th>
18
-
19
- Property
20
-
21
-
22
- </th><th>
23
-
24
- Modifiers
25
-
26
-
27
- </th><th>
28
-
29
- Type
30
-
31
-
32
- </th><th>
33
-
34
- Description
35
-
36
-
37
- </th></tr></thead>
38
- <tbody><tr><td>
39
-
40
- [document](./foundation-testing.fixture.document.md)
41
-
42
-
43
- </td><td>
44
-
45
-
46
- </td><td>
47
-
48
- Document
49
-
50
-
51
- </td><td>
52
-
53
- The document the fixture is running in.
54
-
55
-
56
- </td></tr>
57
- <tr><td>
58
-
59
- [element](./foundation-testing.fixture.element.md)
60
-
61
-
62
- </td><td>
63
-
64
-
65
- </td><td>
66
-
67
- TElement
68
-
69
-
70
- </td><td>
71
-
72
- The first element in the [Fixture.view](./foundation-testing.fixture.view.md)<!-- -->.
73
-
74
-
75
- </td></tr>
76
- <tr><td>
77
-
78
- [parent](./foundation-testing.fixture.parent.md)
79
-
80
-
81
- </td><td>
82
-
83
-
84
- </td><td>
85
-
86
- HTMLElement
87
-
88
-
89
- </td><td>
90
-
91
- The parent element that the view was appended to.
92
-
93
-
94
- </td></tr>
95
- <tr><td>
96
-
97
- [template](./foundation-testing.fixture.template.md)
98
-
99
-
100
- </td><td>
101
-
102
-
103
- </td><td>
104
-
105
- ViewTemplate
106
-
107
-
108
- </td><td>
109
-
110
- The template the fixture was created from.
111
-
112
-
113
- </td></tr>
114
- <tr><td>
115
-
116
- [view](./foundation-testing.fixture.view.md)
117
-
118
-
119
- </td><td>
120
-
121
-
122
- </td><td>
123
-
124
- HTMLView
125
-
126
-
127
- </td><td>
128
-
129
- The view that was created from the fixture's template.
130
-
131
-
132
- </td></tr>
133
- </tbody></table>
134
-
135
- ## Methods
136
-
137
- <table><thead><tr><th>
138
-
139
- Method
140
-
141
-
142
- </th><th>
143
-
144
- Description
145
-
146
-
147
- </th></tr></thead>
148
- <tbody><tr><td>
149
-
150
- [connect()](./foundation-testing.fixture.connect.md)
151
-
152
-
153
- </td><td>
154
-
155
- Adds the [Fixture.parent](./foundation-testing.fixture.parent.md) to the DOM, causing the connect lifecycle to begin.
156
-
157
-
158
- </td></tr>
159
- <tr><td>
160
-
161
- [disconnect()](./foundation-testing.fixture.disconnect.md)
162
-
163
-
164
- </td><td>
165
-
166
- Removes the [Fixture.parent](./foundation-testing.fixture.parent.md) from the DOM, causing the disconnect lifecycle to begin.
167
-
168
-
169
- </td></tr>
170
- </tbody></table>
171
-
@@ -1,18 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Fixture](./foundation-testing.fixture.md) &gt; [parent](./foundation-testing.fixture.parent.md)
4
-
5
- ## Fixture.parent property
6
-
7
- The parent element that the view was appended to.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- parent: HTMLElement;
13
- ```
14
-
15
- ## Remarks
16
-
17
- This element will be appended to the DOM only after [Fixture.connect()](./foundation-testing.fixture.connect.md) has been called.
18
-
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Fixture](./foundation-testing.fixture.md) &gt; [template](./foundation-testing.fixture.template.md)
4
-
5
- ## Fixture.template property
6
-
7
- The template the fixture was created from.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- template: ViewTemplate;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [Fixture](./foundation-testing.fixture.md) &gt; [view](./foundation-testing.fixture.view.md)
4
-
5
- ## Fixture.view property
6
-
7
- The view that was created from the fixture's template.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- view: HTMLView;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [FixtureOptions](./foundation-testing.fixtureoptions.md) &gt; [context](./foundation-testing.fixtureoptions.context.md)
4
-
5
- ## FixtureOptions.context property
6
-
7
- The execution context to use during binding.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- context?: ExecutionContext;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [FixtureOptions](./foundation-testing.fixtureoptions.md) &gt; [designSystem](./foundation-testing.fixtureoptions.designsystem.md)
4
-
5
- ## FixtureOptions.designSystem property
6
-
7
- A pre-configured design system instance used in setting up the fixture.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- designSystem?: DesignSystem;
13
- ```
@@ -1,13 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [FixtureOptions](./foundation-testing.fixtureoptions.md) &gt; [document](./foundation-testing.fixtureoptions.document.md)
4
-
5
- ## FixtureOptions.document property
6
-
7
- The document to run the fixture in.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- document?: Document;
13
- ```
@@ -1,134 +0,0 @@
1
- <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
-
3
- [Home](./index.md) &gt; [@genesislcap/foundation-testing](./foundation-testing.md) &gt; [FixtureOptions](./foundation-testing.fixtureoptions.md)
4
-
5
- ## FixtureOptions interface
6
-
7
- Options used to customize the creation of the unit test fixture.
8
-
9
- **Signature:**
10
-
11
- ```typescript
12
- export interface FixtureOptions
13
- ```
14
-
15
- ## Properties
16
-
17
- <table><thead><tr><th>
18
-
19
- Property
20
-
21
-
22
- </th><th>
23
-
24
- Modifiers
25
-
26
-
27
- </th><th>
28
-
29
- Type
30
-
31
-
32
- </th><th>
33
-
34
- Description
35
-
36
-
37
- </th></tr></thead>
38
- <tbody><tr><td>
39
-
40
- [context?](./foundation-testing.fixtureoptions.context.md)
41
-
42
-
43
- </td><td>
44
-
45
-
46
- </td><td>
47
-
48
- ExecutionContext
49
-
50
-
51
- </td><td>
52
-
53
- _(Optional)_ The execution context to use during binding.
54
-
55
-
56
- </td></tr>
57
- <tr><td>
58
-
59
- [designSystem?](./foundation-testing.fixtureoptions.designsystem.md)
60
-
61
-
62
- </td><td>
63
-
64
-
65
- </td><td>
66
-
67
- DesignSystem
68
-
69
-
70
- </td><td>
71
-
72
- _(Optional)_ A pre-configured design system instance used in setting up the fixture.
73
-
74
-
75
- </td></tr>
76
- <tr><td>
77
-
78
- [document?](./foundation-testing.fixtureoptions.document.md)
79
-
80
-
81
- </td><td>
82
-
83
-
84
- </td><td>
85
-
86
- Document
87
-
88
-
89
- </td><td>
90
-
91
- _(Optional)_ The document to run the fixture in.
92
-
93
-
94
- </td></tr>
95
- <tr><td>
96
-
97
- [parent?](./foundation-testing.fixtureoptions.parent.md)
98
-
99
-
100
- </td><td>
101
-
102
-
103
- </td><td>
104
-
105
- HTMLElement
106
-
107
-
108
- </td><td>
109
-
110
- _(Optional)_ The parent element to append the fixture to.
111
-
112
-
113
- </td></tr>
114
- <tr><td>
115
-
116
- [source?](./foundation-testing.fixtureoptions.source.md)
117
-
118
-
119
- </td><td>
120
-
121
-
122
- </td><td>
123
-
124
- any
125
-
126
-
127
- </td><td>
128
-
129
- _(Optional)_ The data source to bind the HTML to.
130
-
131
-
132
- </td></tr>
133
- </tbody></table>
134
-