@genesislcap/foundation-testing 14.226.0 → 14.226.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.
- package/dist/cjs/component/fixture.js +2 -2
- package/dist/cjs/playwright/test.js +2 -2
- package/dist/cjs/playwright-bdd/index.js +2 -2
- package/dist/esm/component/fixture.js +2 -2
- package/dist/esm/playwright/test.js +2 -2
- package/dist/esm/playwright-bdd/index.js +2 -2
- package/dist/foundation-testing.api.json +22 -90
- package/dist/tsdoc-metadata.json +1 -1
- package/docs/api/foundation-testing.delayedresolve.md +1 -12
- package/docs/api/foundation-testing.md +2 -2
- package/docs/api/foundation-testing.timeout.md +1 -12
- package/package.json +6 -6
- /package/docs/{api-report.md.api.md → api-report.md} +0 -0
|
@@ -25,8 +25,8 @@ function isElementRegistry(obj) {
|
|
|
25
25
|
* Yields control to the caller one Microtask later, in order to
|
|
26
26
|
* ensure that the DOM has settled. This has changed in the latest version of FAST!
|
|
27
27
|
*/
|
|
28
|
-
function fixture(
|
|
29
|
-
return tslib_1.__awaiter(this,
|
|
28
|
+
function fixture(templateNameOrRegistry, options = {}) {
|
|
29
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
30
30
|
const document = options.document || globalThis.document;
|
|
31
31
|
const parent = options.parent || document.createElement('div');
|
|
32
32
|
const source = options.source || {};
|
|
@@ -43,14 +43,14 @@ exports.defaultAuditThresholds = {
|
|
|
43
43
|
exports.test = test_1.test.extend({
|
|
44
44
|
config: [exports.defaultPackageConfig, { option: true, scope: 'worker', timeout: 60000 }],
|
|
45
45
|
port: [
|
|
46
|
-
(
|
|
46
|
+
({ config }, use) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
47
47
|
const port = (0, portfinder_sync_1.getPort)((config === null || config === void 0 ? void 0 : config.PORT) || process.env.PORT || exports.defaultPackageConfig.PORT);
|
|
48
48
|
yield use(port);
|
|
49
49
|
}),
|
|
50
50
|
{ scope: 'worker' }, // option: true
|
|
51
51
|
],
|
|
52
52
|
browser: [
|
|
53
|
-
(
|
|
53
|
+
({ port }, use) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
54
54
|
const browser = yield test_1.chromium.launch({
|
|
55
55
|
args: [`--remote-debugging-port=${port}`],
|
|
56
56
|
});
|
|
@@ -15,14 +15,14 @@ exports.test = PlaywrightBDD.test;
|
|
|
15
15
|
exports.testConfig = {
|
|
16
16
|
config: [test_2.defaultPackageConfig, { option: true, scope: 'worker', timeout: 60000 }],
|
|
17
17
|
port: [
|
|
18
|
-
(
|
|
18
|
+
({ config }, use) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
19
|
const port = (0, portfinder_sync_1.getPort)((config === null || config === void 0 ? void 0 : config.PORT) || process.env.PORT || test_2.defaultPackageConfig.PORT);
|
|
20
20
|
yield use(port);
|
|
21
21
|
}),
|
|
22
22
|
{ scope: 'worker' },
|
|
23
23
|
],
|
|
24
24
|
browser: [
|
|
25
|
-
(
|
|
25
|
+
({ port }, use) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
26
26
|
const browser = yield test_1.chromium.launch({
|
|
27
27
|
args: [`--remote-debugging-port=${port}`],
|
|
28
28
|
});
|
|
@@ -22,8 +22,8 @@ function isElementRegistry(obj) {
|
|
|
22
22
|
* Yields control to the caller one Microtask later, in order to
|
|
23
23
|
* ensure that the DOM has settled. This has changed in the latest version of FAST!
|
|
24
24
|
*/
|
|
25
|
-
export function fixture(
|
|
26
|
-
return __awaiter(this,
|
|
25
|
+
export function fixture(templateNameOrRegistry, options = {}) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
27
|
const document = options.document || globalThis.document;
|
|
28
28
|
const parent = options.parent || document.createElement('div');
|
|
29
29
|
const source = options.source || {};
|
|
@@ -37,14 +37,14 @@ export const defaultAuditThresholds = {
|
|
|
37
37
|
export const test = base.extend({
|
|
38
38
|
config: [defaultPackageConfig, { option: true, scope: 'worker', timeout: 60000 }],
|
|
39
39
|
port: [
|
|
40
|
-
(
|
|
40
|
+
({ config }, use) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
41
|
const port = getPort((config === null || config === void 0 ? void 0 : config.PORT) || process.env.PORT || defaultPackageConfig.PORT);
|
|
42
42
|
yield use(port);
|
|
43
43
|
}),
|
|
44
44
|
{ scope: 'worker' }, // option: true
|
|
45
45
|
],
|
|
46
46
|
browser: [
|
|
47
|
-
(
|
|
47
|
+
({ port }, use) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
48
|
const browser = yield chromium.launch({
|
|
49
49
|
args: [`--remote-debugging-port=${port}`],
|
|
50
50
|
});
|
|
@@ -12,14 +12,14 @@ export const test = PlaywrightBDD.test;
|
|
|
12
12
|
export const testConfig = {
|
|
13
13
|
config: [defaultPackageConfig, { option: true, scope: 'worker', timeout: 60000 }],
|
|
14
14
|
port: [
|
|
15
|
-
(
|
|
15
|
+
({ config }, use) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
const port = getPort((config === null || config === void 0 ? void 0 : config.PORT) || process.env.PORT || defaultPackageConfig.PORT);
|
|
17
17
|
yield use(port);
|
|
18
18
|
}),
|
|
19
19
|
{ scope: 'worker' },
|
|
20
20
|
],
|
|
21
21
|
browser: [
|
|
22
|
-
(
|
|
22
|
+
({ port }, use) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
23
|
const browser = yield chromium.launch({
|
|
24
24
|
args: [`--remote-debugging-port=${port}`],
|
|
25
25
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
3
|
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.
|
|
4
|
+
"toolVersion": "7.34.9",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -556,33 +556,17 @@
|
|
|
556
556
|
"name": "createLogicSuite"
|
|
557
557
|
},
|
|
558
558
|
{
|
|
559
|
-
"kind": "
|
|
560
|
-
"canonicalReference": "@genesislcap/foundation-testing!delayedResolve:
|
|
559
|
+
"kind": "Variable",
|
|
560
|
+
"canonicalReference": "@genesislcap/foundation-testing!delayedResolve:var",
|
|
561
561
|
"docComment": "/**\n * Delayed resolve utility.\n *\n * @param result - The result of the promise.\n *\n * @param duration - An optional duration in milliseconds. Defaults to 500.\n *\n * @example\n * ```ts\n * test('delayed resolve', async () => {\n * const mockAPI = delayedResolve({ foo: 'bar' }, 2_000);\n * const result = await mockAPI();\n * });\n * ```\n *\n * @public\n */\n",
|
|
562
562
|
"excerptTokens": [
|
|
563
563
|
{
|
|
564
564
|
"kind": "Content",
|
|
565
|
-
"text": "delayedResolve:
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
"kind": "Content",
|
|
569
|
-
"text": "unknown"
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
"kind": "Content",
|
|
573
|
-
"text": ", duration?: "
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
"kind": "Content",
|
|
577
|
-
"text": "number"
|
|
565
|
+
"text": "delayedResolve: "
|
|
578
566
|
},
|
|
579
567
|
{
|
|
580
568
|
"kind": "Content",
|
|
581
|
-
"text": ") => "
|
|
582
|
-
},
|
|
583
|
-
{
|
|
584
|
-
"kind": "Content",
|
|
585
|
-
"text": "() => "
|
|
569
|
+
"text": "(result: unknown, duration?: number) => () => "
|
|
586
570
|
},
|
|
587
571
|
{
|
|
588
572
|
"kind": "Reference",
|
|
@@ -595,31 +579,13 @@
|
|
|
595
579
|
}
|
|
596
580
|
],
|
|
597
581
|
"fileUrlPath": "src/utils/promise.ts",
|
|
598
|
-
"
|
|
599
|
-
"startIndex": 5,
|
|
600
|
-
"endIndex": 8
|
|
601
|
-
},
|
|
582
|
+
"isReadonly": true,
|
|
602
583
|
"releaseTag": "Public",
|
|
603
|
-
"
|
|
604
|
-
"
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
"startIndex": 1,
|
|
609
|
-
"endIndex": 2
|
|
610
|
-
},
|
|
611
|
-
"isOptional": false
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
"parameterName": "duration",
|
|
615
|
-
"parameterTypeTokenRange": {
|
|
616
|
-
"startIndex": 3,
|
|
617
|
-
"endIndex": 4
|
|
618
|
-
},
|
|
619
|
-
"isOptional": true
|
|
620
|
-
}
|
|
621
|
-
],
|
|
622
|
-
"name": "delayedResolve"
|
|
584
|
+
"name": "delayedResolve",
|
|
585
|
+
"variableTypeTokenRange": {
|
|
586
|
+
"startIndex": 1,
|
|
587
|
+
"endIndex": 4
|
|
588
|
+
}
|
|
623
589
|
},
|
|
624
590
|
{
|
|
625
591
|
"kind": "TypeAlias",
|
|
@@ -1984,17 +1950,17 @@
|
|
|
1984
1950
|
"name": "testSpy"
|
|
1985
1951
|
},
|
|
1986
1952
|
{
|
|
1987
|
-
"kind": "
|
|
1988
|
-
"canonicalReference": "@genesislcap/foundation-testing!timeout:
|
|
1953
|
+
"kind": "Variable",
|
|
1954
|
+
"canonicalReference": "@genesislcap/foundation-testing!timeout:var",
|
|
1989
1955
|
"docComment": "/**\n * Timeout utility.\n *\n * @param callback - The async test function.\n *\n * @param duration - An optional duration in milliseconds. Defaults to 5_000.\n *\n * @example\n *\n * A promise that never ends.\n * ```ts\n * test(\n * 'should fail',\n * timeout(async () => {\n * await new Promise(() => {});\n * assert.ok(true);\n * }, 5_000),\n * );\n * ```\n *\n * @example\n *\n * A slow API.\n * ```ts\n * test(\n * 'should fail',\n * timeout(async () => {\n * const slowMockAPI = delayedResolve({ foo: 'bar' }, 4_000);\n * await slowMockAPI();\n * assert.unreachable('should have timed out');\n * }, 2_000),\n * );\n * ```\n *\n * @public\n */\n",
|
|
1990
1956
|
"excerptTokens": [
|
|
1991
1957
|
{
|
|
1992
1958
|
"kind": "Content",
|
|
1993
|
-
"text": "timeout:
|
|
1959
|
+
"text": "timeout: "
|
|
1994
1960
|
},
|
|
1995
1961
|
{
|
|
1996
1962
|
"kind": "Content",
|
|
1997
|
-
"text": "(context: any) => "
|
|
1963
|
+
"text": "(callback: (context: any) => "
|
|
1998
1964
|
},
|
|
1999
1965
|
{
|
|
2000
1966
|
"kind": "Reference",
|
|
@@ -2003,23 +1969,7 @@
|
|
|
2003
1969
|
},
|
|
2004
1970
|
{
|
|
2005
1971
|
"kind": "Content",
|
|
2006
|
-
"text": "<any
|
|
2007
|
-
},
|
|
2008
|
-
{
|
|
2009
|
-
"kind": "Content",
|
|
2010
|
-
"text": ", duration?: "
|
|
2011
|
-
},
|
|
2012
|
-
{
|
|
2013
|
-
"kind": "Content",
|
|
2014
|
-
"text": "number"
|
|
2015
|
-
},
|
|
2016
|
-
{
|
|
2017
|
-
"kind": "Content",
|
|
2018
|
-
"text": ") => "
|
|
2019
|
-
},
|
|
2020
|
-
{
|
|
2021
|
-
"kind": "Content",
|
|
2022
|
-
"text": "(context: any) => "
|
|
1972
|
+
"text": "<any>, duration?: number) => (context: any) => "
|
|
2023
1973
|
},
|
|
2024
1974
|
{
|
|
2025
1975
|
"kind": "Reference",
|
|
@@ -2032,31 +1982,13 @@
|
|
|
2032
1982
|
}
|
|
2033
1983
|
],
|
|
2034
1984
|
"fileUrlPath": "src/uvu/uvu.ts",
|
|
2035
|
-
"
|
|
2036
|
-
"startIndex": 7,
|
|
2037
|
-
"endIndex": 10
|
|
2038
|
-
},
|
|
1985
|
+
"isReadonly": true,
|
|
2039
1986
|
"releaseTag": "Public",
|
|
2040
|
-
"
|
|
2041
|
-
"
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
"startIndex": 1,
|
|
2046
|
-
"endIndex": 4
|
|
2047
|
-
},
|
|
2048
|
-
"isOptional": false
|
|
2049
|
-
},
|
|
2050
|
-
{
|
|
2051
|
-
"parameterName": "duration",
|
|
2052
|
-
"parameterTypeTokenRange": {
|
|
2053
|
-
"startIndex": 5,
|
|
2054
|
-
"endIndex": 6
|
|
2055
|
-
},
|
|
2056
|
-
"isOptional": true
|
|
2057
|
-
}
|
|
2058
|
-
],
|
|
2059
|
-
"name": "timeout"
|
|
1987
|
+
"name": "timeout",
|
|
1988
|
+
"variableTypeTokenRange": {
|
|
1989
|
+
"startIndex": 1,
|
|
1990
|
+
"endIndex": 6
|
|
1991
|
+
}
|
|
2060
1992
|
},
|
|
2061
1993
|
{
|
|
2062
1994
|
"kind": "TypeAlias",
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [delayedResolve](./foundation-testing.delayedresolve.md)
|
|
4
4
|
|
|
5
|
-
## delayedResolve
|
|
5
|
+
## delayedResolve variable
|
|
6
6
|
|
|
7
7
|
Delayed resolve utility.
|
|
8
8
|
|
|
@@ -12,17 +12,6 @@ Delayed resolve utility.
|
|
|
12
12
|
delayedResolve: (result: unknown, duration?: number) => () => Promise<unknown>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
| Parameter | Type | Description |
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| result | unknown | The result of the promise. |
|
|
20
|
-
| duration | number | _(Optional)_ An optional duration in milliseconds. Defaults to 500. |
|
|
21
|
-
|
|
22
|
-
**Returns:**
|
|
23
|
-
|
|
24
|
-
() => Promise<unknown>
|
|
25
|
-
|
|
26
15
|
## Example
|
|
27
16
|
|
|
28
17
|
|
|
@@ -10,13 +10,11 @@
|
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| [createComponentSuite(title, elementNameOrGetter, context, registrations)](./foundation-testing.createcomponentsuite.md) | Create component test suite. |
|
|
12
12
|
| [createLogicSuite(title, context)](./foundation-testing.createlogicsuite.md) | Create logic test suite. |
|
|
13
|
-
| [delayedResolve(result, duration)](./foundation-testing.delayedresolve.md) | Delayed resolve utility. |
|
|
14
13
|
| [fixture(templateNameOrRegistry, options)](./foundation-testing.fixture.md) | Creates a test fixture suitable for testing custom elements, templates, and bindings. |
|
|
15
14
|
| [resetTestHarness(wrapper)](./foundation-testing.resettestharness.md) | 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. |
|
|
16
15
|
| [restoreTestHarness(wrapper)](./foundation-testing.restoretestharness.md) | Restores the spied functions back to the original functions without the spies. |
|
|
17
16
|
| [runCases(fn, cases, assertion)](./foundation-testing.runcases.md) | Assert a set of test cases. |
|
|
18
17
|
| [testSpy(constructor)](./foundation-testing.testspy.md) | Decorator: Used on a test harness class based on a <code>FoundationElement</code> 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. |
|
|
19
|
-
| [timeout(callback, duration)](./foundation-testing.timeout.md) | Timeout utility. |
|
|
20
18
|
|
|
21
19
|
## Interfaces
|
|
22
20
|
|
|
@@ -31,7 +29,9 @@
|
|
|
31
29
|
|
|
32
30
|
| Variable | Description |
|
|
33
31
|
| --- | --- |
|
|
32
|
+
| [delayedResolve](./foundation-testing.delayedresolve.md) | Delayed resolve utility. |
|
|
34
33
|
| [logger](./foundation-testing.logger.md) | Test logger |
|
|
34
|
+
| [timeout](./foundation-testing.timeout.md) | Timeout utility. |
|
|
35
35
|
|
|
36
36
|
## Type Aliases
|
|
37
37
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[Home](./index.md) > [@genesislcap/foundation-testing](./foundation-testing.md) > [timeout](./foundation-testing.timeout.md)
|
|
4
4
|
|
|
5
|
-
## timeout
|
|
5
|
+
## timeout variable
|
|
6
6
|
|
|
7
7
|
Timeout utility.
|
|
8
8
|
|
|
@@ -12,17 +12,6 @@ Timeout utility.
|
|
|
12
12
|
timeout: (callback: (context: any) => Promise<any>, duration?: number) => (context: any) => Promise<any>
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
| Parameter | Type | Description |
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| callback | (context: any) => Promise<any> | The async test function. |
|
|
20
|
-
| duration | number | _(Optional)_ An optional duration in milliseconds. Defaults to 5\_000. |
|
|
21
|
-
|
|
22
|
-
**Returns:**
|
|
23
|
-
|
|
24
|
-
(context: any) => Promise<any>
|
|
25
|
-
|
|
26
15
|
## Example 1
|
|
27
16
|
|
|
28
17
|
A promise that never ends.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-testing",
|
|
3
3
|
"description": "Genesis Foundation Testing",
|
|
4
|
-
"version": "14.226.
|
|
4
|
+
"version": "14.226.1",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -72,14 +72,14 @@
|
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@esbuild-kit/cjs-loader": "2.4.2",
|
|
74
74
|
"@microsoft/api-documenter": "^7.19.13",
|
|
75
|
-
"@microsoft/api-extractor": "7.
|
|
75
|
+
"@microsoft/api-extractor": "7.34.9",
|
|
76
76
|
"@types/node": "^20.8.7",
|
|
77
77
|
"@types/sinon": "^10.0.13",
|
|
78
78
|
"rimraf": "^5.0.0",
|
|
79
|
-
"typescript": "
|
|
79
|
+
"typescript": "^4.9.5"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@genesislcap/foundation-logger": "14.226.
|
|
82
|
+
"@genesislcap/foundation-logger": "14.226.1",
|
|
83
83
|
"@microsoft/fast-element": "1.14.0",
|
|
84
84
|
"@microsoft/fast-foundation": "2.49.6",
|
|
85
85
|
"@playwright/test": "^1.46.1",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"playwright-lighthouse": "^2.2.2",
|
|
90
90
|
"portfinder-sync": "^0.0.2",
|
|
91
91
|
"sinon": "^17.0.1",
|
|
92
|
-
"tslib": "2.
|
|
92
|
+
"tslib": "^2.3.1",
|
|
93
93
|
"tsm": "^2.2.1",
|
|
94
94
|
"uvu": "0.5.4"
|
|
95
95
|
},
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"publishConfig": {
|
|
102
102
|
"access": "public"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "e691c1741d135edca5271f338f62df8154efb99c"
|
|
105
105
|
}
|
|
File without changes
|