@fluidframework/test-utils 2.0.0-internal.6.4.0 → 2.0.0-internal.7.1.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/CHANGELOG.md +64 -0
- package/api-extractor.json +9 -1
- package/api-report/test-utils.api.md +385 -0
- package/dist/TestSummaryUtils.d.ts.map +1 -1
- package/dist/TestSummaryUtils.js +10 -7
- package/dist/TestSummaryUtils.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/localCodeLoader.d.ts +2 -2
- package/dist/localCodeLoader.d.ts.map +1 -1
- package/dist/localCodeLoader.js +8 -1
- package/dist/localCodeLoader.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/test-utils-alpha.d.ts +675 -0
- package/dist/test-utils-beta.d.ts +675 -0
- package/dist/test-utils-public.d.ts +675 -0
- package/dist/test-utils.d.ts +675 -0
- package/dist/testContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/testContainerRuntimeFactory.js +8 -3
- package/dist/testContainerRuntimeFactory.js.map +1 -1
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts +22 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js +24 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js.map +1 -0
- package/dist/testFluidObject.d.ts +1 -1
- package/dist/testFluidObject.d.ts.map +1 -1
- package/dist/testFluidObject.js +21 -19
- package/dist/testFluidObject.js.map +1 -1
- package/dist/testObjectProvider.d.ts +0 -2
- package/dist/testObjectProvider.d.ts.map +1 -1
- package/dist/testObjectProvider.js +4 -29
- package/dist/testObjectProvider.js.map +1 -1
- package/dist/timeoutUtils.d.ts +1 -1
- package/dist/timeoutUtils.d.ts.map +1 -1
- package/dist/timeoutUtils.js +7 -7
- package/dist/timeoutUtils.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +34 -34
- package/src/TestSummaryUtils.ts +13 -12
- package/src/index.ts +1 -0
- package/src/localCodeLoader.ts +6 -5
- package/src/packageVersion.ts +1 -1
- package/src/testContainerRuntimeFactory.ts +5 -2
- package/src/testContainerRuntimeFactoryWithDefaultDataStore.ts +50 -0
- package/src/testFluidObject.ts +4 -3
- package/src/testObjectProvider.ts +3 -41
package/dist/localCodeLoader.js
CHANGED
|
@@ -39,7 +39,14 @@ class LocalCodeLoader {
|
|
|
39
39
|
fluidModule = {
|
|
40
40
|
fluidExport: {
|
|
41
41
|
...maybeExport,
|
|
42
|
-
IRuntimeFactory: new aqueduct_1.ContainerRuntimeFactoryWithDefaultDataStore(
|
|
42
|
+
IRuntimeFactory: new aqueduct_1.ContainerRuntimeFactoryWithDefaultDataStore({
|
|
43
|
+
defaultFactory,
|
|
44
|
+
registryEntries: [
|
|
45
|
+
[defaultFactory.type, Promise.resolve(defaultFactory)],
|
|
46
|
+
],
|
|
47
|
+
requestHandlers: [innerRequestHandler],
|
|
48
|
+
runtimeOptions,
|
|
49
|
+
}),
|
|
43
50
|
},
|
|
44
51
|
};
|
|
45
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localCodeLoader.js","sourceRoot":"","sources":["../src/localCodeLoader.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,oDAA4B;AAC5B,uDAAuF;AAevF,iEAAuE;AAavE;;;GAGG;AACH,MAAa,eAAe;IAG3B,YACC,cAA8D,EAC9D,cAAyC;QAJzB,sBAAiB,GAAG,IAAI,GAAG,EAAmC,CAAC;QAM/E,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE;YACnC,sEAAsE;YACtE,8EAA8E;YAC9E,qGAAqG;YACrG,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC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,cAAc,CAAC,CAAC;SAClD;IACF,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,IAAI,CAAC,MAAyB;QAC1C,iFAAiF;QACjF,8EAA8E;QAC9E,qGAAqG;QACrG,MAAM,KAAK,GACV,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;YACjC,CAAC,CAAC,MAAM,CAAC,OAAO;YAChB,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAEvD,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrD,IAAI,UAAU,KAAK,SAAS,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,uBAAuB,KAAK,EAAE,CAAC,CAAC;SAChD;QACD,OAAO,UAAU,CAAC;IACnB,CAAC;CACD;AA7ED,0CA6EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport assert from \"assert\";\nimport { ContainerRuntimeFactoryWithDefaultDataStore } from \"@fluidframework/aqueduct\";\nimport {\n\tIProvideRuntimeFactory,\n\tIFluidModule,\n\tIProvideFluidCodeDetailsComparer,\n\tIFluidCodeDetails,\n\tICodeDetailsLoader,\n\tIFluidModuleWithDetails,\n} from \"@fluidframework/container-definitions\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport {\n\tIContainerRuntimeBase,\n\tIProvideFluidDataStoreFactory,\n\tIProvideFluidDataStoreRegistry,\n} from \"@fluidframework/runtime-definitions\";\nimport { createDataStoreFactory } from \"@fluidframework/runtime-utils\";\nimport { IContainerRuntimeOptions } from \"@fluidframework/container-runtime\";\n\nexport type SupportedExportInterfaces = Partial<\n\tIProvideRuntimeFactory &\n\t\tIProvideFluidDataStoreFactory &\n\t\tIProvideFluidDataStoreRegistry &\n\t\tIProvideFluidCodeDetailsComparer\n>;\n\n// Represents the entry point for a Fluid container.\nexport type fluidEntryPoint = SupportedExportInterfaces | IFluidModule;\n\n/**\n * A simple code loader that caches a mapping of package name to a Fluid entry point.\n * On load, it retrieves the entry point matching the package name in the given code details.\n */\nexport class LocalCodeLoader implements ICodeDetailsLoader {\n\tprivate readonly fluidPackageCache = new Map<string, IFluidModuleWithDetails>();\n\n\tconstructor(\n\t\tpackageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n\t\truntimeOptions?: IContainerRuntimeOptions,\n\t) {\n\t\tfor (const entry of packageEntries) {\n\t\t\t// Store the entry point against a unique id in the fluidPackageCache.\n\t\t\t// For code details containing a package name, use the package name as the id.\n\t\t\t// For code details containing a Fluid package, create a unique id from the package name and version.\n\t\t\tconst source = entry[0];\n\t\t\tconst pkgId =\n\t\t\t\ttypeof source.package === \"string\"\n\t\t\t\t\t? source.package\n\t\t\t\t\t: `${source.package.name}@${source.package.version}`;\n\t\t\tlet fluidModule = entry[1] as IFluidModule;\n\t\t\tif (fluidModule?.fluidExport === undefined) {\n\t\t\t\tconst maybeExport = fluidModule as SupportedExportInterfaces;\n\n\t\t\t\tif (maybeExport.IRuntimeFactory !== undefined) {\n\t\t\t\t\tfluidModule = { fluidExport: maybeExport };\n\t\t\t\t} else {\n\t\t\t\t\tassert(maybeExport.IFluidDataStoreFactory !== undefined);\n\t\t\t\t\tconst defaultFactory = createDataStoreFactory(\n\t\t\t\t\t\t\"default\",\n\t\t\t\t\t\tmaybeExport.IFluidDataStoreFactory,\n\t\t\t\t\t);\n\t\t\t\t\tconst innerRequestHandler = async (\n\t\t\t\t\t\trequest: IRequest,\n\t\t\t\t\t\truntime: IContainerRuntimeBase,\n\t\t\t\t\t) => runtime.IFluidHandleContext.resolveHandle(request);\n\t\t\t\t\tfluidModule = {\n\t\t\t\t\t\tfluidExport: {\n\t\t\t\t\t\t\t...maybeExport,\n\t\t\t\t\t\t\tIRuntimeFactory: new ContainerRuntimeFactoryWithDefaultDataStore({\n\t\t\t\t\t\t\t\tdefaultFactory,\n\t\t\t\t\t\t\t\tregistryEntries: [\n\t\t\t\t\t\t\t\t\t[defaultFactory.type, Promise.resolve(defaultFactory)],\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\trequestHandlers: [innerRequestHandler],\n\t\t\t\t\t\t\t\truntimeOptions,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst runtimeFactory = {\n\t\t\t\tmodule: fluidModule,\n\t\t\t\tdetails: source,\n\t\t\t};\n\n\t\t\tthis.fluidPackageCache.set(pkgId, runtimeFactory);\n\t\t}\n\t}\n\n\t/**\n\t * It finds the entry point for the package name in the given source and return it\n\t * as a Fluid module.\n\t * @param source - Details of where to find chaincode\n\t */\n\tpublic async load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails> {\n\t\t// Get the entry point for from the fluidPackageCache for the given code details.\n\t\t// For code details containing a package name, use the package name as the id.\n\t\t// For code details containing a Fluid package, create a unique id from the package name and version.\n\t\tconst pkdId =\n\t\t\ttypeof source.package === \"string\"\n\t\t\t\t? source.package\n\t\t\t\t: `${source.package.name}@${source.package.version}`;\n\n\t\tconst entryPoint = this.fluidPackageCache.get(pkdId);\n\t\tif (entryPoint === undefined) {\n\t\t\tthrow new Error(`Cannot find package ${pkdId}`);\n\t\t}\n\t\treturn entryPoint;\n\t}\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-internal.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-internal.7.1.0";
|
|
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-internal.
|
|
11
|
+
exports.pkgVersion = "2.0.0-internal.7.1.0";
|
|
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,sBAAsB,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-internal.
|
|
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,sBAAsB,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-internal.7.1.0\";\n"]}
|