@fluidframework/test-utils 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.217212
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/api-extractor-lint.json +13 -0
- package/api-extractor.json +0 -4
- package/api-report/test-utils.api.md +81 -75
- package/dist/DriverWrappers.d.ts +3 -0
- package/dist/DriverWrappers.d.ts.map +1 -1
- package/dist/DriverWrappers.js +3 -0
- package/dist/DriverWrappers.js.map +1 -1
- package/dist/TestConfigs.d.ts +4 -1
- package/dist/TestConfigs.d.ts.map +1 -1
- package/dist/TestConfigs.js +3 -0
- package/dist/TestConfigs.js.map +1 -1
- package/dist/TestSummaryUtils.d.ts +4 -2
- package/dist/TestSummaryUtils.d.ts.map +1 -1
- package/dist/TestSummaryUtils.js +3 -0
- package/dist/TestSummaryUtils.js.map +1 -1
- package/dist/containerUtils.d.ts +11 -0
- package/dist/containerUtils.d.ts.map +1 -1
- package/dist/containerUtils.js +27 -2
- package/dist/containerUtils.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +6 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/loaderContainerTracker.d.ts +3 -0
- package/dist/loaderContainerTracker.d.ts.map +1 -1
- package/dist/loaderContainerTracker.js +3 -0
- package/dist/loaderContainerTracker.js.map +1 -1
- package/dist/localCodeLoader.d.ts +7 -0
- package/dist/localCodeLoader.d.ts.map +1 -1
- package/dist/localCodeLoader.js +1 -0
- package/dist/localCodeLoader.js.map +1 -1
- package/dist/localLoader.d.ts +2 -0
- package/dist/localLoader.d.ts.map +1 -1
- package/dist/localLoader.js +2 -0
- package/dist/localLoader.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/retry.d.ts +1 -0
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +1 -0
- package/dist/retry.js.map +1 -1
- package/dist/test-utils-alpha.d.ts +138 -659
- package/dist/test-utils-beta.d.ts +176 -678
- package/dist/test-utils-public.d.ts +176 -678
- package/dist/test-utils-untrimmed.d.ts +350 -39
- package/dist/testContainerRuntimeFactory.d.ts +2 -0
- package/dist/testContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/testContainerRuntimeFactory.js +15 -7
- package/dist/testContainerRuntimeFactory.js.map +1 -1
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts +1 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js +1 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/dist/testFluidObject.d.ts +5 -0
- package/dist/testFluidObject.d.ts.map +1 -1
- package/dist/testFluidObject.js +2 -0
- package/dist/testFluidObject.js.map +1 -1
- package/dist/testObjectProvider.d.ts +287 -37
- package/dist/testObjectProvider.d.ts.map +1 -1
- package/dist/testObjectProvider.js +310 -25
- package/dist/testObjectProvider.js.map +1 -1
- package/dist/timeoutUtils.d.ts +11 -0
- package/dist/timeoutUtils.d.ts.map +1 -1
- package/dist/timeoutUtils.js +5 -0
- package/dist/timeoutUtils.js.map +1 -1
- package/lib/test-utils-alpha.d.ts +138 -659
- package/lib/test-utils-beta.d.ts +176 -678
- package/lib/test-utils-public.d.ts +176 -678
- package/lib/test-utils-untrimmed.d.ts +350 -39
- package/package.json +34 -24
- package/src/DriverWrappers.ts +3 -0
- package/src/TestConfigs.ts +4 -1
- package/src/TestSummaryUtils.ts +9 -2
- package/src/containerUtils.ts +27 -1
- package/src/index.ts +7 -1
- package/src/interfaces.ts +6 -0
- package/src/loaderContainerTracker.ts +3 -0
- package/src/localCodeLoader.ts +7 -0
- package/src/localLoader.ts +2 -0
- package/src/packageVersion.ts +1 -1
- package/src/retry.ts +1 -0
- package/src/testContainerRuntimeFactory.ts +24 -5
- package/src/testContainerRuntimeFactoryWithDefaultDataStore.ts +1 -0
- package/src/testFluidObject.ts +5 -0
- package/src/testObjectProvider.ts +524 -47
- package/src/timeoutUtils.ts +11 -0
package/dist/localLoader.js
CHANGED
|
@@ -13,6 +13,7 @@ const localCodeLoader_1 = require("./localCodeLoader");
|
|
|
13
13
|
* @param documentServiceFactory - the driver factory to use
|
|
14
14
|
* @param urlResolver - the url resolver to use
|
|
15
15
|
* @param options - loader options
|
|
16
|
+
* @internal
|
|
16
17
|
*/
|
|
17
18
|
function createLoader(packageEntries, documentServiceFactory, urlResolver, logger, options) {
|
|
18
19
|
const codeLoader = new localCodeLoader_1.LocalCodeLoader(packageEntries);
|
|
@@ -30,6 +31,7 @@ exports.createLoader = createLoader;
|
|
|
30
31
|
* @param source - The code details used to create the Container.
|
|
31
32
|
* @param loader - The loader to use to initialize the container.
|
|
32
33
|
* @param attachRequest - The request to create new from.
|
|
34
|
+
* @internal
|
|
33
35
|
*/
|
|
34
36
|
async function createAndAttachContainer(source, loader, attachRequest) {
|
|
35
37
|
const container = await loader.createDetachedContainer(source);
|
package/dist/localLoader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localLoader.js","sourceRoot":"","sources":["../src/localLoader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,uEAA0D;AAG1D,uDAAqE;AAErE
|
|
1
|
+
{"version":3,"file":"localLoader.js","sourceRoot":"","sources":["../src/localLoader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,uEAA0D;AAG1D,uDAAqE;AAErE;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC3B,cAA8D,EAC9D,sBAA+C,EAC/C,WAAyB,EACzB,MAA6B,EAC7B,OAAwB;IAExB,MAAM,UAAU,GAAuB,IAAI,iCAAe,CAAC,cAAc,CAAC,CAAC;IAE3E,OAAO,IAAI,yBAAM,CAAC;QACjB,WAAW;QACX,sBAAsB;QACtB,UAAU;QACV,MAAM;QACN,OAAO;KACP,CAAC,CAAC;AACJ,CAAC;AAhBD,oCAgBC;AAED;;;;;;GAMG;AAEI,KAAK,UAAU,wBAAwB,CAC7C,MAAyB,EACzB,MAAmB,EACnB,aAAuB;IAEvB,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAEtC,OAAO,SAAS,CAAC;AAClB,CAAC;AATD,4DASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tICodeDetailsLoader,\n\tIContainer,\n\tIHostLoader,\n\tILoaderOptions,\n\tIFluidCodeDetails,\n} from \"@fluidframework/container-definitions\";\nimport { Loader } from \"@fluidframework/container-loader\";\nimport { ITelemetryBaseLogger, IRequest } from \"@fluidframework/core-interfaces\";\nimport { IDocumentServiceFactory, IUrlResolver } from \"@fluidframework/driver-definitions\";\nimport { fluidEntryPoint, LocalCodeLoader } from \"./localCodeLoader\";\n\n/**\n * Creates a loader with the given package entries and driver.\n * @param packageEntries - A list of code details to Fluid entry points.\n * @param documentServiceFactory - the driver factory to use\n * @param urlResolver - the url resolver to use\n * @param options - loader options\n * @internal\n */\nexport function createLoader(\n\tpackageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n\tdocumentServiceFactory: IDocumentServiceFactory,\n\turlResolver: IUrlResolver,\n\tlogger?: ITelemetryBaseLogger,\n\toptions?: ILoaderOptions,\n): IHostLoader {\n\tconst codeLoader: ICodeDetailsLoader = new LocalCodeLoader(packageEntries);\n\n\treturn new Loader({\n\t\turlResolver,\n\t\tdocumentServiceFactory,\n\t\tcodeLoader,\n\t\tlogger,\n\t\toptions,\n\t});\n}\n\n/**\n * Creates a detached Container and attaches it.\n * @param source - The code details used to create the Container.\n * @param loader - The loader to use to initialize the container.\n * @param attachRequest - The request to create new from.\n * @internal\n */\n\nexport async function createAndAttachContainer(\n\tsource: IFluidCodeDetails,\n\tloader: IHostLoader,\n\tattachRequest: IRequest,\n): Promise<IContainer> {\n\tconst container = await loader.createDetachedContainer(source);\n\tawait container.attach(attachRequest);\n\n\treturn container;\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/test-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev.7.4.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev.7.4.0.217212";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/test-utils";
|
|
11
|
-
exports.pkgVersion = "2.0.0-dev.7.4.0.
|
|
11
|
+
exports.pkgVersion = "2.0.0-dev.7.4.0.217212";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"2.0.0-dev.7.4.0.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"2.0.0-dev.7.4.0.217212\";\n"]}
|
package/dist/retry.d.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @param maxTries - maximum number of attempts
|
|
13
13
|
* @param backOffMs - back off between attempts in milliseconds
|
|
14
14
|
* @returns the actual value from the callback when successful or the default value otherwise
|
|
15
|
+
* @internal
|
|
15
16
|
*/
|
|
16
17
|
export declare const retryWithEventualValue: <T>(callback: () => Promise<T>, check: (value: T) => boolean, defaultValue: T, maxTries?: number, backOffMs?: number) => Promise<T>;
|
|
17
18
|
//# sourceMappingURL=retry.d.ts.map
|
package/dist/retry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,uDAEb,OAAO,uEAiB3B,CAAC"}
|
package/dist/retry.js
CHANGED
|
@@ -28,6 +28,7 @@ const retry = async (callback, defaultValue, maxTries, backOffMs) => {
|
|
|
28
28
|
* @param maxTries - maximum number of attempts
|
|
29
29
|
* @param backOffMs - back off between attempts in milliseconds
|
|
30
30
|
* @returns the actual value from the callback when successful or the default value otherwise
|
|
31
|
+
* @internal
|
|
31
32
|
*/
|
|
32
33
|
const retryWithEventualValue = async (callback, check, defaultValue, maxTries = 20, backOffMs = 50) => retry(async () => {
|
|
33
34
|
const value = await callback();
|
package/dist/retry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAmD;AAEnD,MAAM,KAAK,GAAG,KAAK,EAClB,QAA0B,EAC1B,YAAe,EACf,QAAgB,EAChB,SAAiB,EACJ,EAAE;IACf,KAAK,IAAI,UAAU,GAAG,CAAC,EAAE,UAAU,IAAI,QAAQ,EAAE,UAAU,EAAE,EAAE;QAC9D,IAAI;YACH,MAAM,MAAM,GAAG,MAAM,QAAQ,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC;SACd;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,IAAA,kBAAK,EAAC,UAAU,GAAG,SAAS,CAAC,CAAC;SACpC;KACD;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAmD;AAEnD,MAAM,KAAK,GAAG,KAAK,EAClB,QAA0B,EAC1B,YAAe,EACf,QAAgB,EAChB,SAAiB,EACJ,EAAE;IACf,KAAK,IAAI,UAAU,GAAG,CAAC,EAAE,UAAU,IAAI,QAAQ,EAAE,UAAU,EAAE,EAAE;QAC9D,IAAI;YACH,MAAM,MAAM,GAAG,MAAM,QAAQ,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC;SACd;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,IAAA,kBAAK,EAAC,UAAU,GAAG,SAAS,CAAC,CAAC;SACpC;KACD;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACI,MAAM,sBAAsB,GAAG,KAAK,EAC1C,QAA0B,EAC1B,KAA4B,EAC5B,YAAe,EACf,QAAQ,GAAG,EAAE,EACb,SAAS,GAAG,EAAE,EACD,EAAE,CACf,KAAK,CACJ,KAAK,IAAI,EAAE;IACV,MAAM,KAAK,GAAG,MAAM,QAAQ,EAAE,CAAC;IAC/B,IAAI,KAAK,CAAC,KAAK,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC;KACb;IAED,MAAM,KAAK,CAAC,WAAW,CAAC,CAAC;AAC1B,CAAC,EACD,YAAY,EACZ,QAAQ,EACR,SAAS,CACT,CAAC;AAnBU,QAAA,sBAAsB,0BAmBhC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { delay } from \"@fluidframework/core-utils\";\n\nconst retry = async <T>(\n\tcallback: () => Promise<T>,\n\tdefaultValue: T,\n\tmaxTries: number,\n\tbackOffMs: number,\n): Promise<T> => {\n\tfor (let currentTry = 1; currentTry <= maxTries; currentTry++) {\n\t\ttry {\n\t\t\tconst result = await callback();\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tawait delay(currentTry * backOffMs);\n\t\t}\n\t}\n\n\treturn Promise.resolve(defaultValue);\n};\n\n/**\n * Simple retry mechanism with linear back off to call\n * a function which may eventually return an accepted value.\n *\n * @param callback - the function to execute\n * @param check - the function to check if the value is acceptable\n * @param defaultValue - the default value\n * @param maxTries - maximum number of attempts\n * @param backOffMs - back off between attempts in milliseconds\n * @returns the actual value from the callback when successful or the default value otherwise\n * @internal\n */\nexport const retryWithEventualValue = async <T>(\n\tcallback: () => Promise<T>,\n\tcheck: (value: T) => boolean,\n\tdefaultValue: T,\n\tmaxTries = 20,\n\tbackOffMs = 50,\n): Promise<T> =>\n\tretry(\n\t\tasync () => {\n\t\t\tconst value = await callback();\n\t\t\tif (check(value)) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tthrow Error(\"Not ready\");\n\t\t},\n\t\tdefaultValue,\n\t\tmaxTries,\n\t\tbackOffMs,\n\t);\n"]}
|