@genesislcap/foundation-testing 14.302.0 → 14.302.1-alpha-945e484.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/dist/cjs/component/fixture.js +3 -4
- package/dist/cjs/jsdom/setup.js +12 -1
- package/dist/cjs/playwright/test.js +2 -2
- package/dist/cjs/playwright-bdd/index.js +2 -2
- package/dist/cjs/suite/suite.js +4 -4
- package/dist/cjs/utils/harness.js +3 -4
- package/dist/dts/jsdom/setup.d.ts.map +1 -1
- package/dist/dts/playwright/test.d.ts.map +1 -1
- package/dist/dts/utils/promise.d.ts.map +1 -1
- package/dist/dts/uvu/uvu.d.ts.map +1 -1
- package/dist/esm/component/fixture.js +2 -2
- package/dist/esm/jsdom/setup.js +12 -1
- package/dist/esm/playwright/test.js +2 -2
- package/dist/esm/playwright-bdd/index.js +2 -2
- package/dist/foundation-testing.api.json +90 -22
- package/dist/tsdoc-metadata.json +1 -1
- package/docs/api/foundation-testing.componentcontext.md +73 -5
- package/docs/api/foundation-testing.createcomponentsuite.md +81 -6
- package/docs/api/foundation-testing.createlogicsuite.md +49 -4
- package/docs/api/foundation-testing.delayedresolve.md +57 -1
- package/docs/api/foundation-testing.fixture.md +151 -11
- package/docs/api/foundation-testing.fixtureoptions.md +117 -7
- package/docs/api/foundation-testing.logiccontext.md +23 -3
- package/docs/api/foundation-testing.logiccontext.runcases.md +45 -4
- package/docs/api/foundation-testing.md +299 -31
- package/docs/api/foundation-testing.resettestharness.md +33 -3
- package/docs/api/foundation-testing.restoretestharness.md +33 -3
- package/docs/api/foundation-testing.testspy.md +31 -3
- package/docs/api/foundation-testing.timeout.md +57 -1
- package/docs/api/index.md +21 -3
- package/docs/api-report.md.api.md +143 -0
- package/package.json +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixture =
|
|
3
|
+
exports.fixture = fixture;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fast_element_1 = require("@microsoft/fast-element");
|
|
6
6
|
const fast_foundation_1 = require("@microsoft/fast-foundation");
|
|
@@ -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_1) {
|
|
29
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (templateNameOrRegistry, options = {}) {
|
|
30
30
|
const document = options.document || globalThis.document;
|
|
31
31
|
const parent = options.parent || document.createElement('div');
|
|
32
32
|
const source = options.source || {};
|
|
@@ -87,4 +87,3 @@ function fixture(templateNameOrRegistry, options = {}) {
|
|
|
87
87
|
};
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
exports.fixture = fixture;
|
package/dist/cjs/jsdom/setup.js
CHANGED
|
@@ -96,7 +96,18 @@ const setup = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
|
96
96
|
globalThis.localStorage = window.localStorage;
|
|
97
97
|
globalThis.sessionStorage = window.sessionStorage;
|
|
98
98
|
globalThis.MutationObserver = window.MutationObserver;
|
|
99
|
-
|
|
99
|
+
// Handle navigator property assignment for Node.js v22+ compatibility
|
|
100
|
+
try {
|
|
101
|
+
globalThis.navigator = window.navigator;
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
// In Node.js v22+, navigator is read-only, so we need to use Object.defineProperty
|
|
105
|
+
Object.defineProperty(globalThis, 'navigator', {
|
|
106
|
+
value: window.navigator,
|
|
107
|
+
writable: false,
|
|
108
|
+
configurable: true,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
100
111
|
globalThis.location = window.location;
|
|
101
112
|
globalThis.history = window.history;
|
|
102
113
|
globalThis.Node = window.Node;
|
|
@@ -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
|
+
(_a, use_1) => tslib_1.__awaiter(void 0, [_a, use_1], void 0, function* ({ config }, use) {
|
|
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
|
+
(_a, use_1) => tslib_1.__awaiter(void 0, [_a, use_1], void 0, function* ({ port }, use) {
|
|
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
|
+
(_a, use_1) => tslib_1.__awaiter(void 0, [_a, use_1], void 0, function* ({ config }, use) {
|
|
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
|
+
(_a, use_1) => tslib_1.__awaiter(void 0, [_a, use_1], void 0, function* ({ port }, use) {
|
|
26
26
|
const browser = yield test_1.chromium.launch({
|
|
27
27
|
args: [`--remote-debugging-port=${port}`],
|
|
28
28
|
});
|
package/dist/cjs/suite/suite.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.sinon = void 0;
|
|
4
|
+
exports.runCases = runCases;
|
|
5
|
+
exports.createComponentSuite = createComponentSuite;
|
|
6
|
+
exports.createLogicSuite = createLogicSuite;
|
|
4
7
|
const tslib_1 = require("tslib");
|
|
5
8
|
const fast_foundation_1 = require("@microsoft/fast-foundation");
|
|
6
9
|
const component_1 = require("../component");
|
|
@@ -21,7 +24,6 @@ function runCases(fn, cases, assertion = uvu_1.assert.equal) {
|
|
|
21
24
|
uvu_1.assert.type(fn, 'function');
|
|
22
25
|
cases.forEach(([actual, expects, msg], index) => assertion(fn(...actual), expects, msg !== null && msg !== void 0 ? msg : JSON.stringify(actual, null, 2)));
|
|
23
26
|
}
|
|
24
|
-
exports.runCases = runCases;
|
|
25
27
|
/**
|
|
26
28
|
* Create component test suite.
|
|
27
29
|
*
|
|
@@ -138,7 +140,6 @@ function createComponentSuite(title, elementNameOrGetter, context, registrations
|
|
|
138
140
|
}));
|
|
139
141
|
return Suite;
|
|
140
142
|
}
|
|
141
|
-
exports.createComponentSuite = createComponentSuite;
|
|
142
143
|
/**
|
|
143
144
|
* Create logic test suite.
|
|
144
145
|
*
|
|
@@ -178,4 +179,3 @@ function createLogicSuite(title, context) {
|
|
|
178
179
|
} }, context));
|
|
179
180
|
return Suite;
|
|
180
181
|
}
|
|
181
|
-
exports.createLogicSuite = createLogicSuite;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.testSpy = testSpy;
|
|
4
|
+
exports.resetTestHarness = resetTestHarness;
|
|
5
|
+
exports.restoreTestHarness = restoreTestHarness;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
7
|
const sinon_1 = tslib_1.__importDefault(require("sinon"));
|
|
6
8
|
/**
|
|
@@ -48,7 +50,6 @@ function testSpy(constructor) {
|
|
|
48
50
|
.filter(shouldSpy(constructor.prototype))
|
|
49
51
|
.forEach((p) => constructor['_test'].spy(constructor.prototype, p));
|
|
50
52
|
}
|
|
51
|
-
exports.testSpy = testSpy;
|
|
52
53
|
/**
|
|
53
54
|
* Resets the history of the spied functions on the objects so previous running tests
|
|
54
55
|
* don't affect the current test.
|
|
@@ -59,7 +60,6 @@ exports.testSpy = testSpy;
|
|
|
59
60
|
function resetTestHarness(wrapper) {
|
|
60
61
|
wrapper.constructor['_test'].resetHistory();
|
|
61
62
|
}
|
|
62
|
-
exports.resetTestHarness = resetTestHarness;
|
|
63
63
|
/**
|
|
64
64
|
* Restores the spied functions back to the original functions without the spies.
|
|
65
65
|
* @param wrapper - `WithTestHarness<T>` object to restore
|
|
@@ -68,4 +68,3 @@ exports.resetTestHarness = resetTestHarness;
|
|
|
68
68
|
function restoreTestHarness(wrapper) {
|
|
69
69
|
wrapper.constructor['_test'].restore();
|
|
70
70
|
}
|
|
71
|
-
exports.restoreTestHarness = restoreTestHarness;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/jsdom/setup.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/jsdom/setup.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,eAAO,MAAM,KAAK,qBA8GjB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,qBAkDpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/playwright/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/playwright/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChD,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAU,2BAA2B,0BAA0B,iBAGpF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,eAAO,MAAM,oBAAoB,EAAE,aAKlC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAMpC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,EAAE,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,6PAmBf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../../src/utils/promise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../../src/utils/promise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,GACxB,QAAQ,OAAO,EAAE,WAAU,MAAY,2BAMvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uvu.d.ts","sourceRoot":"","sources":["../../../src/uvu/uvu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,QAAA,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"uvu.d.ts","sourceRoot":"","sources":["../../../src/uvu/uvu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,QAAA,MAAM,OAAO,GAAI,UAAU,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EAAE,WAAU,MAAc,MACzE,YAAO,iBAWhB,CAAC;AAEF;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -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_1) {
|
|
26
|
+
return __awaiter(this, arguments, void 0, function* (templateNameOrRegistry, options = {}) {
|
|
27
27
|
const document = options.document || globalThis.document;
|
|
28
28
|
const parent = options.parent || document.createElement('div');
|
|
29
29
|
const source = options.source || {};
|
package/dist/esm/jsdom/setup.js
CHANGED
|
@@ -93,7 +93,18 @@ export const setup = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
93
93
|
globalThis.localStorage = window.localStorage;
|
|
94
94
|
globalThis.sessionStorage = window.sessionStorage;
|
|
95
95
|
globalThis.MutationObserver = window.MutationObserver;
|
|
96
|
-
|
|
96
|
+
// Handle navigator property assignment for Node.js v22+ compatibility
|
|
97
|
+
try {
|
|
98
|
+
globalThis.navigator = window.navigator;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
// In Node.js v22+, navigator is read-only, so we need to use Object.defineProperty
|
|
102
|
+
Object.defineProperty(globalThis, 'navigator', {
|
|
103
|
+
value: window.navigator,
|
|
104
|
+
writable: false,
|
|
105
|
+
configurable: true,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
97
108
|
globalThis.location = window.location;
|
|
98
109
|
globalThis.history = window.history;
|
|
99
110
|
globalThis.Node = window.Node;
|
|
@@ -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
|
+
(_a, use_1) => __awaiter(void 0, [_a, use_1], void 0, function* ({ config }, use) {
|
|
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
|
+
(_a, use_1) => __awaiter(void 0, [_a, use_1], void 0, function* ({ port }, use) {
|
|
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
|
+
(_a, use_1) => __awaiter(void 0, [_a, use_1], void 0, function* ({ config }, use) {
|
|
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
|
+
(_a, use_1) => __awaiter(void 0, [_a, use_1], void 0, function* ({ port }, use) {
|
|
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.52.10",
|
|
5
5
|
"schemaVersion": 1011,
|
|
6
6
|
"oldestForwardsCompatibleVersion": 1001,
|
|
7
7
|
"tsdocConfig": {
|
|
@@ -556,17 +556,33 @@
|
|
|
556
556
|
"name": "createLogicSuite"
|
|
557
557
|
},
|
|
558
558
|
{
|
|
559
|
-
"kind": "
|
|
560
|
-
"canonicalReference": "@genesislcap/foundation-testing!delayedResolve:
|
|
559
|
+
"kind": "Function",
|
|
560
|
+
"canonicalReference": "@genesislcap/foundation-testing!delayedResolve:function(1)",
|
|
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: "
|
|
565
|
+
"text": "delayedResolve: (result: "
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"kind": "Content",
|
|
569
|
+
"text": "unknown"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"kind": "Content",
|
|
573
|
+
"text": ", duration?: "
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"kind": "Content",
|
|
577
|
+
"text": "number"
|
|
566
578
|
},
|
|
567
579
|
{
|
|
568
580
|
"kind": "Content",
|
|
569
|
-
"text": "
|
|
581
|
+
"text": ") => "
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"kind": "Content",
|
|
585
|
+
"text": "() => "
|
|
570
586
|
},
|
|
571
587
|
{
|
|
572
588
|
"kind": "Reference",
|
|
@@ -579,13 +595,31 @@
|
|
|
579
595
|
}
|
|
580
596
|
],
|
|
581
597
|
"fileUrlPath": "src/utils/promise.ts",
|
|
582
|
-
"
|
|
598
|
+
"returnTypeTokenRange": {
|
|
599
|
+
"startIndex": 5,
|
|
600
|
+
"endIndex": 8
|
|
601
|
+
},
|
|
583
602
|
"releaseTag": "Public",
|
|
584
|
-
"
|
|
585
|
-
"
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
603
|
+
"overloadIndex": 1,
|
|
604
|
+
"parameters": [
|
|
605
|
+
{
|
|
606
|
+
"parameterName": "result",
|
|
607
|
+
"parameterTypeTokenRange": {
|
|
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"
|
|
589
623
|
},
|
|
590
624
|
{
|
|
591
625
|
"kind": "TypeAlias",
|
|
@@ -1950,17 +1984,17 @@
|
|
|
1950
1984
|
"name": "testSpy"
|
|
1951
1985
|
},
|
|
1952
1986
|
{
|
|
1953
|
-
"kind": "
|
|
1954
|
-
"canonicalReference": "@genesislcap/foundation-testing!timeout:
|
|
1987
|
+
"kind": "Function",
|
|
1988
|
+
"canonicalReference": "@genesislcap/foundation-testing!timeout:function(1)",
|
|
1955
1989
|
"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",
|
|
1956
1990
|
"excerptTokens": [
|
|
1957
1991
|
{
|
|
1958
1992
|
"kind": "Content",
|
|
1959
|
-
"text": "timeout: "
|
|
1993
|
+
"text": "timeout: (callback: "
|
|
1960
1994
|
},
|
|
1961
1995
|
{
|
|
1962
1996
|
"kind": "Content",
|
|
1963
|
-
"text": "(
|
|
1997
|
+
"text": "(context: any) => "
|
|
1964
1998
|
},
|
|
1965
1999
|
{
|
|
1966
2000
|
"kind": "Reference",
|
|
@@ -1969,7 +2003,23 @@
|
|
|
1969
2003
|
},
|
|
1970
2004
|
{
|
|
1971
2005
|
"kind": "Content",
|
|
1972
|
-
"text": "<any
|
|
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) => "
|
|
1973
2023
|
},
|
|
1974
2024
|
{
|
|
1975
2025
|
"kind": "Reference",
|
|
@@ -1982,13 +2032,31 @@
|
|
|
1982
2032
|
}
|
|
1983
2033
|
],
|
|
1984
2034
|
"fileUrlPath": "src/uvu/uvu.ts",
|
|
1985
|
-
"
|
|
2035
|
+
"returnTypeTokenRange": {
|
|
2036
|
+
"startIndex": 7,
|
|
2037
|
+
"endIndex": 10
|
|
2038
|
+
},
|
|
1986
2039
|
"releaseTag": "Public",
|
|
1987
|
-
"
|
|
1988
|
-
"
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2040
|
+
"overloadIndex": 1,
|
|
2041
|
+
"parameters": [
|
|
2042
|
+
{
|
|
2043
|
+
"parameterName": "callback",
|
|
2044
|
+
"parameterTypeTokenRange": {
|
|
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"
|
|
1992
2060
|
},
|
|
1993
2061
|
{
|
|
1994
2062
|
"kind": "TypeAlias",
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -15,9 +15,77 @@ export interface ComponentContext<TElement = HTMLElement> extends Pick<Fixture<T
|
|
|
15
15
|
|
|
16
16
|
## Properties
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
<table><thead><tr><th>
|
|
19
|
+
|
|
20
|
+
Property
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
</th><th>
|
|
24
|
+
|
|
25
|
+
Modifiers
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
</th><th>
|
|
29
|
+
|
|
30
|
+
Type
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
</th><th>
|
|
34
|
+
|
|
35
|
+
Description
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</th></tr></thead>
|
|
39
|
+
<tbody><tr><td>
|
|
40
|
+
|
|
41
|
+
[container](./foundation-testing.componentcontext.container.md)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
</td><td>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
</td><td>
|
|
48
|
+
|
|
49
|
+
Container
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
</td><td>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
</td></tr>
|
|
56
|
+
<tr><td>
|
|
57
|
+
|
|
58
|
+
[designSystem](./foundation-testing.componentcontext.designsystem.md)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
</td><td>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
</td><td>
|
|
65
|
+
|
|
66
|
+
DesignSystem
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
</td><td>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
</td></tr>
|
|
73
|
+
<tr><td>
|
|
74
|
+
|
|
75
|
+
[runCases](./foundation-testing.componentcontext.runcases.md)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</td><td>
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
</td><td>
|
|
82
|
+
|
|
83
|
+
[RunCases](./foundation-testing.runcases.md)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
</td><td>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
</td></tr>
|
|
90
|
+
</tbody></table>
|
|
23
91
|
|
|
@@ -14,12 +14,87 @@ export declare function createComponentSuite<TElement = HTMLElement>(title: stri
|
|
|
14
14
|
|
|
15
15
|
## Parameters
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
elementNameOrGetter
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
</td><td>
|
|
55
|
+
|
|
56
|
+
string \| [ElementGetter](./foundation-testing.elementgetter.md)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
Element tag name or getter which is used to create the element within the fixture
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
</td></tr>
|
|
65
|
+
<tr><td>
|
|
66
|
+
|
|
67
|
+
context
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</td><td>
|
|
71
|
+
|
|
72
|
+
[ComponentContext](./foundation-testing.componentcontext.md)<!-- --><TElement>
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
</td><td>
|
|
76
|
+
|
|
77
|
+
_(Optional)_ Optional component context [ComponentContext](./foundation-testing.componentcontext.md)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
</td></tr>
|
|
81
|
+
<tr><td>
|
|
82
|
+
|
|
83
|
+
registrations
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
</td><td>
|
|
87
|
+
|
|
88
|
+
Registration<any>\[\]
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
</td><td>
|
|
92
|
+
|
|
93
|
+
_(Optional)_ Optional array of DI container registrations
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
</td></tr>
|
|
97
|
+
</tbody></table>
|
|
23
98
|
|
|
24
99
|
**Returns:**
|
|
25
100
|
|
|
@@ -14,10 +14,55 @@ export declare function createLogicSuite<TContext = LogicContext>(title: string,
|
|
|
14
14
|
|
|
15
15
|
## Parameters
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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>
|
|
21
66
|
|
|
22
67
|
**Returns:**
|
|
23
68
|
|