@fluidframework/test-utils 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.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 (65) hide show
  1. package/.eslintrc.js +8 -10
  2. package/README.md +41 -11
  3. package/api-extractor.json +2 -2
  4. package/dist/DriverWrappers.d.ts.map +1 -1
  5. package/dist/DriverWrappers.js.map +1 -1
  6. package/dist/TestConfigs.d.ts.map +1 -1
  7. package/dist/TestConfigs.js +3 -2
  8. package/dist/TestConfigs.js.map +1 -1
  9. package/dist/TestSummaryUtils.d.ts +15 -4
  10. package/dist/TestSummaryUtils.d.ts.map +1 -1
  11. package/dist/TestSummaryUtils.js +23 -17
  12. package/dist/TestSummaryUtils.js.map +1 -1
  13. package/dist/containerUtils.d.ts +1 -2
  14. package/dist/containerUtils.d.ts.map +1 -1
  15. package/dist/containerUtils.js +4 -2
  16. package/dist/containerUtils.js.map +1 -1
  17. package/dist/index.d.ts +4 -4
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/interfaces.d.ts.map +1 -1
  22. package/dist/interfaces.js.map +1 -1
  23. package/dist/loaderContainerTracker.d.ts.map +1 -1
  24. package/dist/loaderContainerTracker.js +37 -27
  25. package/dist/loaderContainerTracker.js.map +1 -1
  26. package/dist/localCodeLoader.d.ts.map +1 -1
  27. package/dist/localCodeLoader.js.map +1 -1
  28. package/dist/localLoader.d.ts.map +1 -1
  29. package/dist/localLoader.js.map +1 -1
  30. package/dist/packageVersion.d.ts +1 -1
  31. package/dist/packageVersion.js +1 -1
  32. package/dist/packageVersion.js.map +1 -1
  33. package/dist/retry.d.ts.map +1 -1
  34. package/dist/retry.js.map +1 -1
  35. package/dist/testContainerRuntimeFactory.d.ts.map +1 -1
  36. package/dist/testContainerRuntimeFactory.js +2 -1
  37. package/dist/testContainerRuntimeFactory.js.map +1 -1
  38. package/dist/testFluidObject.d.ts.map +1 -1
  39. package/dist/testFluidObject.js +7 -3
  40. package/dist/testFluidObject.js.map +1 -1
  41. package/dist/testObjectProvider.d.ts +4 -1
  42. package/dist/testObjectProvider.d.ts.map +1 -1
  43. package/dist/testObjectProvider.js +28 -11
  44. package/dist/testObjectProvider.js.map +1 -1
  45. package/dist/timeoutUtils.d.ts.map +1 -1
  46. package/dist/timeoutUtils.js +4 -3
  47. package/dist/timeoutUtils.js.map +1 -1
  48. package/package.json +66 -55
  49. package/prettier.config.cjs +1 -1
  50. package/src/DriverWrappers.ts +40 -37
  51. package/src/TestConfigs.ts +9 -7
  52. package/src/TestSummaryUtils.ts +113 -119
  53. package/src/containerUtils.ts +20 -18
  54. package/src/index.ts +24 -25
  55. package/src/interfaces.ts +10 -7
  56. package/src/loaderContainerTracker.ts +627 -565
  57. package/src/localCodeLoader.ts +85 -77
  58. package/src/localLoader.ts +24 -24
  59. package/src/packageVersion.ts +1 -1
  60. package/src/retry.ts +31 -25
  61. package/src/testContainerRuntimeFactory.ts +59 -56
  62. package/src/testFluidObject.ts +168 -152
  63. package/src/testObjectProvider.ts +445 -384
  64. package/src/timeoutUtils.ts +174 -154
  65. package/tsconfig.json +9 -16
@@ -5,11 +5,11 @@
5
5
 
6
6
  import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
7
7
  import {
8
- IDocumentService,
9
- IDocumentServiceFactory,
10
- IDocumentStorageService,
11
- IResolvedUrl,
12
- ISummaryContext,
8
+ IDocumentService,
9
+ IDocumentServiceFactory,
10
+ IDocumentStorageService,
11
+ IResolvedUrl,
12
+ ISummaryContext,
13
13
  } from "@fluidframework/driver-definitions";
14
14
  import { ISummaryTree } from "@fluidframework/protocol-definitions";
15
15
 
@@ -19,18 +19,18 @@ import { ISummaryTree } from "@fluidframework/protocol-definitions";
19
19
  * callback before it is uploaded to the server.
20
20
  */
21
21
  export function wrapDocumentStorageService(
22
- innerDocStorageService: IDocumentStorageService,
23
- uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
22
+ innerDocStorageService: IDocumentStorageService,
23
+ uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
24
24
  ) {
25
- const outerDocStorageService = Object.create(innerDocStorageService) as IDocumentStorageService;
26
- outerDocStorageService.uploadSummaryWithContext = async (
27
- summary: ISummaryTree,
28
- context: ISummaryContext,
29
- ): Promise<string> => {
30
- const newContext = uploadSummaryCb(summary, context);
31
- return innerDocStorageService.uploadSummaryWithContext(summary, newContext);
32
- };
33
- return outerDocStorageService;
25
+ const outerDocStorageService = Object.create(innerDocStorageService) as IDocumentStorageService;
26
+ outerDocStorageService.uploadSummaryWithContext = async (
27
+ summary: ISummaryTree,
28
+ context: ISummaryContext,
29
+ ): Promise<string> => {
30
+ const newContext = uploadSummaryCb(summary, context);
31
+ return innerDocStorageService.uploadSummaryWithContext(summary, newContext);
32
+ };
33
+ return outerDocStorageService;
34
34
  }
35
35
 
36
36
  /**
@@ -41,15 +41,15 @@ export function wrapDocumentStorageService(
41
41
  * to pass in the `uploadSummaryCb`.
42
42
  */
43
43
  export function wrapDocumentService(
44
- innerDocService: IDocumentService,
45
- uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
44
+ innerDocService: IDocumentService,
45
+ uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
46
46
  ) {
47
- const outerDocService = Object.create(innerDocService) as IDocumentService;
48
- outerDocService.connectToStorage = async (): Promise<IDocumentStorageService> => {
49
- const storageService = await innerDocService.connectToStorage();
50
- return wrapDocumentStorageService(storageService, uploadSummaryCb);
51
- };
52
- return outerDocService;
47
+ const outerDocService = Object.create(innerDocService) as IDocumentService;
48
+ outerDocService.connectToStorage = async (): Promise<IDocumentStorageService> => {
49
+ const storageService = await innerDocService.connectToStorage();
50
+ return wrapDocumentStorageService(storageService, uploadSummaryCb);
51
+ };
52
+ return outerDocService;
53
53
  }
54
54
 
55
55
  /**
@@ -60,18 +60,21 @@ export function wrapDocumentService(
60
60
  * pass in the `uploadSummaryCb`.
61
61
  */
62
62
  export function wrapDocumentServiceFactory(
63
- innerDocServiceFactory: IDocumentServiceFactory,
64
- uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
63
+ innerDocServiceFactory: IDocumentServiceFactory,
64
+ uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
65
65
  ) {
66
- const outerDocServiceFactory = Object.create(innerDocServiceFactory) as IDocumentServiceFactory;
67
- outerDocServiceFactory.createDocumentService = async (
68
- resolvedUrl: IResolvedUrl,
69
- logger?: ITelemetryBaseLogger,
70
- clientIsSummarizer?: boolean,
71
- ): Promise<IDocumentService> => {
72
- const documentService = await innerDocServiceFactory.createDocumentService(
73
- resolvedUrl, logger, clientIsSummarizer);
74
- return wrapDocumentService(documentService, uploadSummaryCb);
75
- };
76
- return outerDocServiceFactory;
66
+ const outerDocServiceFactory = Object.create(innerDocServiceFactory) as IDocumentServiceFactory;
67
+ outerDocServiceFactory.createDocumentService = async (
68
+ resolvedUrl: IResolvedUrl,
69
+ logger?: ITelemetryBaseLogger,
70
+ clientIsSummarizer?: boolean,
71
+ ): Promise<IDocumentService> => {
72
+ const documentService = await innerDocServiceFactory.createDocumentService(
73
+ resolvedUrl,
74
+ logger,
75
+ clientIsSummarizer,
76
+ );
77
+ return wrapDocumentService(documentService, uploadSummaryCb);
78
+ };
79
+ return outerDocServiceFactory;
77
80
  }
@@ -5,10 +5,12 @@
5
5
 
6
6
  import { ConfigTypes, IConfigProviderBase } from "@fluidframework/telemetry-utils";
7
7
 
8
- export const mockConfigProvider = ((settings: Record<string, ConfigTypes> = {}): IConfigProviderBase => {
9
- settings["Fluid.GarbageCollection.TrackGCState"] = "true";
10
- settings["Fluid.GarbageCollection.WriteDataAtRoot"] = "true";
11
- return {
12
- getRawConfig: (name: string): ConfigTypes => settings[name],
13
- };
14
- });
8
+ export const mockConfigProvider = (
9
+ settings: Record<string, ConfigTypes> = {},
10
+ ): IConfigProviderBase => {
11
+ settings["Fluid.GarbageCollection.TrackGCState"] = "true";
12
+ settings["Fluid.GarbageCollection.WriteDataAtRoot"] = "true";
13
+ return {
14
+ getRawConfig: (name: string): ConfigTypes => settings[name],
15
+ };
16
+ };
@@ -7,16 +7,16 @@ import { ContainerRuntimeFactoryWithDefaultDataStore } from "@fluidframework/aqu
7
7
  import { assert } from "@fluidframework/common-utils";
8
8
  import { IContainer, IHostLoader, LoaderHeader } from "@fluidframework/container-definitions";
9
9
  import {
10
- IGCRuntimeOptions,
11
- ISummarizer,
12
- ISummaryRuntimeOptions,
10
+ IGCRuntimeOptions,
11
+ ISummarizer,
12
+ ISummaryRuntimeOptions,
13
13
  } from "@fluidframework/container-runtime";
14
14
  import { FluidObject, IRequest } from "@fluidframework/core-interfaces";
15
15
  import { DriverHeader } from "@fluidframework/driver-definitions";
16
16
  import {
17
- IContainerRuntimeBase,
18
- IFluidDataStoreFactory,
19
- NamedFluidDataStoreRegistryEntries,
17
+ IContainerRuntimeBase,
18
+ IFluidDataStoreFactory,
19
+ NamedFluidDataStoreRegistryEntries,
20
20
  } from "@fluidframework/runtime-definitions";
21
21
  import { requestFluidObject } from "@fluidframework/runtime-utils";
22
22
  import { IConfigProviderBase } from "@fluidframework/telemetry-utils";
@@ -28,137 +28,131 @@ import { timeoutAwait } from "./timeoutUtils";
28
28
 
29
29
  const summarizerClientType = "summarizer";
30
30
 
31
- async function createSummarizerCore(absoluteUrl: string | undefined, loader: IHostLoader, summaryVersion?: string) {
32
- if (absoluteUrl === undefined) {
33
- throw new Error("URL could not be resolved");
34
- }
35
-
36
- const request: IRequest = {
37
- headers: {
38
- [LoaderHeader.cache]: false,
39
- [LoaderHeader.clientDetails]: {
40
- capabilities: { interactive: false },
41
- type: summarizerClientType,
42
- },
43
- [DriverHeader.summarizingClient]: true,
44
- [LoaderHeader.version]: summaryVersion,
45
- },
46
- url: absoluteUrl,
47
- };
48
- const summarizerContainer = await loader.resolve(request);
49
- await waitForContainerConnection(summarizerContainer);
50
-
51
- const fluidObject =
52
- await requestFluidObject<FluidObject<ISummarizer>>(summarizerContainer, { url: "_summarizer" });
53
- if (fluidObject.ISummarizer === undefined) {
54
- throw new Error("Fluid object does not implement ISummarizer");
55
- }
56
-
57
- return {
58
- container: summarizerContainer,
59
- summarizer: fluidObject.ISummarizer,
60
- };
31
+ async function createSummarizerCore(
32
+ container: IContainer,
33
+ loader: IHostLoader,
34
+ summaryVersion?: string,
35
+ ) {
36
+ const absoluteUrl = await container.getAbsoluteUrl("");
37
+ if (absoluteUrl === undefined) {
38
+ throw new Error("URL could not be resolved");
39
+ }
40
+
41
+ const request: IRequest = {
42
+ headers: {
43
+ [LoaderHeader.cache]: false,
44
+ [LoaderHeader.clientDetails]: {
45
+ capabilities: { interactive: false },
46
+ type: summarizerClientType,
47
+ },
48
+ [DriverHeader.summarizingClient]: true,
49
+ [LoaderHeader.version]: summaryVersion,
50
+ },
51
+ url: absoluteUrl,
52
+ };
53
+ const summarizerContainer = await loader.resolve(request);
54
+ await waitForContainerConnection(summarizerContainer);
55
+
56
+ const fluidObject = await requestFluidObject<FluidObject<ISummarizer>>(summarizerContainer, {
57
+ url: "_summarizer",
58
+ });
59
+ if (fluidObject.ISummarizer === undefined) {
60
+ throw new Error("Fluid object does not implement ISummarizer");
61
+ }
62
+
63
+ return {
64
+ container: summarizerContainer,
65
+ summarizer: fluidObject.ISummarizer,
66
+ };
61
67
  }
62
68
 
63
69
  const defaultSummaryOptions: ISummaryRuntimeOptions = {
64
- summaryConfigOverrides: {
65
- state: "disableHeuristics",
66
- maxAckWaitTime: 10000,
67
- maxOpsSinceLastSummary: 7000,
68
- initialSummarizerDelayMs: 0,
69
- },
70
+ summaryConfigOverrides: {
71
+ state: "disableHeuristics",
72
+ maxAckWaitTime: 10000,
73
+ maxOpsSinceLastSummary: 7000,
74
+ initialSummarizerDelayMs: 0,
75
+ },
70
76
  };
71
77
 
78
+ /**
79
+ * Creates a summarizer client from the given container and data store factory, and returns the summarizer client's
80
+ * IContainer and ISummarizer.
81
+ * The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
82
+ */
72
83
  export async function createSummarizerFromFactory(
73
- provider: ITestObjectProvider,
74
- container: IContainer,
75
- dataStoreFactory: IFluidDataStoreFactory,
76
- summaryVersion?: string,
77
- containerRuntimeFactoryType = ContainerRuntimeFactoryWithDefaultDataStore,
78
- registryEntries?: NamedFluidDataStoreRegistryEntries,
79
- ): Promise<ISummarizer> {
80
- const innerRequestHandler = async (request: IRequest, runtime: IContainerRuntimeBase) =>
81
- runtime.IFluidHandleContext.resolveHandle(request);
82
- const runtimeFactory = new containerRuntimeFactoryType(
83
- dataStoreFactory,
84
- registryEntries ??
85
- [
86
- [dataStoreFactory.type, Promise.resolve(dataStoreFactory)],
87
- ],
88
- undefined,
89
- [innerRequestHandler],
90
- { summaryOptions: defaultSummaryOptions },
91
- );
92
-
93
- const loader = provider.createLoader(
94
- [[provider.defaultCodeDetails, runtimeFactory]],
95
- { configProvider: mockConfigProvider() },
96
- );
97
- const absoluteUrl = await container.getAbsoluteUrl("");
98
- return (await createSummarizerCore(absoluteUrl, loader, summaryVersion)).summarizer;
84
+ provider: ITestObjectProvider,
85
+ container: IContainer,
86
+ dataStoreFactory: IFluidDataStoreFactory,
87
+ summaryVersion?: string,
88
+ containerRuntimeFactoryType = ContainerRuntimeFactoryWithDefaultDataStore,
89
+ registryEntries?: NamedFluidDataStoreRegistryEntries,
90
+ ): Promise<{ container: IContainer; summarizer: ISummarizer }> {
91
+ const innerRequestHandler = async (request: IRequest, runtime: IContainerRuntimeBase) =>
92
+ runtime.IFluidHandleContext.resolveHandle(request);
93
+ const runtimeFactory = new containerRuntimeFactoryType(
94
+ dataStoreFactory,
95
+ registryEntries ?? [[dataStoreFactory.type, Promise.resolve(dataStoreFactory)]],
96
+ undefined,
97
+ [innerRequestHandler],
98
+ { summaryOptions: defaultSummaryOptions },
99
+ );
100
+
101
+ const loader = provider.createLoader([[provider.defaultCodeDetails, runtimeFactory]], {
102
+ configProvider: mockConfigProvider(),
103
+ });
104
+ return createSummarizerCore(container, loader, summaryVersion);
99
105
  }
100
106
 
107
+ /**
108
+ * Creates a summarizer client from the given container and returns the summarizer client's IContainer and ISummarizer.
109
+ * The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
110
+ */
101
111
  export async function createSummarizer(
102
- provider: ITestObjectProvider,
103
- container: IContainer,
104
- summaryVersion?: string,
105
- gcOptions?: IGCRuntimeOptions,
106
- configProvider: IConfigProviderBase = mockConfigProvider(),
107
- logger?: ITelemetryBaseLogger,
108
- ): Promise<ISummarizer> {
109
- const absoluteUrl = await container.getAbsoluteUrl("");
110
- return (await createSummarizerWithContainer(
111
- provider,
112
- absoluteUrl,
113
- summaryVersion,
114
- gcOptions,
115
- configProvider,
116
- logger,
117
- )).summarizer;
112
+ provider: ITestObjectProvider,
113
+ container: IContainer,
114
+ summaryVersion?: string,
115
+ gcOptions?: IGCRuntimeOptions,
116
+ configProvider: IConfigProviderBase = mockConfigProvider(),
117
+ logger?: ITelemetryBaseLogger,
118
+ ): Promise<{ container: IContainer; summarizer: ISummarizer }> {
119
+ const testContainerConfig: ITestContainerConfig = {
120
+ runtimeOptions: {
121
+ summaryOptions: defaultSummaryOptions,
122
+ gcOptions,
123
+ },
124
+ loaderProps: { configProvider, logger },
125
+ };
126
+ const loader = provider.makeTestLoader(testContainerConfig);
127
+ return createSummarizerCore(container, loader, summaryVersion);
118
128
  }
119
129
 
120
- export async function createSummarizerWithContainer(
121
- provider: ITestObjectProvider,
122
- absoluteUrl: string | undefined,
123
- summaryVersion?: string,
124
- gcOptions?: IGCRuntimeOptions,
125
- configProvider: IConfigProviderBase = mockConfigProvider(),
126
- logger?: ITelemetryBaseLogger,
127
- ): Promise<{ container: IContainer; summarizer: ISummarizer; }> {
128
- const testContainerConfig: ITestContainerConfig = {
129
- runtimeOptions: {
130
- summaryOptions: defaultSummaryOptions,
131
- gcOptions,
132
- },
133
- loaderProps: { configProvider, logger },
134
- };
135
- const loader = provider.makeTestLoader(testContainerConfig);
136
- return createSummarizerCore(absoluteUrl, loader, summaryVersion);
137
- }
138
130
  /**
139
131
  * Summarizes on demand and returns the summary tree, the version number and the reference sequence number of the
140
132
  * submitted summary.
141
- */
133
+ */
142
134
  export async function summarizeNow(summarizer: ISummarizer, reason: string = "end-to-end test") {
143
- const result = summarizer.summarizeOnDemand({ reason });
135
+ const result = summarizer.summarizeOnDemand({ reason });
144
136
 
145
- const submitResult = await timeoutAwait(result.summarySubmitted);
146
- assert(submitResult.success, "on-demand summary should submit");
147
- assert(submitResult.data.stage === "submit",
148
- "on-demand summary submitted data stage should be submit");
149
- assert(submitResult.data.summaryTree !== undefined, "summary tree should exist");
137
+ const submitResult = await timeoutAwait(result.summarySubmitted);
138
+ assert(submitResult.success, "on-demand summary should submit");
139
+ assert(
140
+ submitResult.data.stage === "submit",
141
+ "on-demand summary submitted data stage should be submit",
142
+ );
143
+ assert(submitResult.data.summaryTree !== undefined, "summary tree should exist");
150
144
 
151
- const broadcastResult = await timeoutAwait(result.summaryOpBroadcasted);
152
- assert(broadcastResult.success, "summary op should be broadcast");
145
+ const broadcastResult = await timeoutAwait(result.summaryOpBroadcasted);
146
+ assert(broadcastResult.success, "summary op should be broadcast");
153
147
 
154
- const ackNackResult = await timeoutAwait(result.receivedSummaryAckOrNack);
155
- assert(ackNackResult.success, "summary op should be acked");
148
+ const ackNackResult = await timeoutAwait(result.receivedSummaryAckOrNack);
149
+ assert(ackNackResult.success, "summary op should be acked");
156
150
 
157
- await new Promise((resolve) => process.nextTick(resolve));
151
+ await new Promise((resolve) => process.nextTick(resolve));
158
152
 
159
- return {
160
- summaryTree: submitResult.data.summaryTree,
161
- summaryVersion: ackNackResult.data.summaryAckOp.contents.handle,
162
- summaryRefSeq: submitResult.data.referenceSequenceNumber,
163
- };
153
+ return {
154
+ summaryTree: submitResult.data.summaryTree,
155
+ summaryVersion: ackNackResult.data.summaryAckOp.contents.handle,
156
+ summaryRefSeq: submitResult.data.referenceSequenceNumber,
157
+ };
164
158
  }
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import { IContainer } from "@fluidframework/container-definitions";
7
- import { ConnectionState, Container } from "@fluidframework/container-loader";
7
+ import { ConnectionState } from "@fluidframework/container-loader";
8
8
  import { PromiseExecutor, timeoutPromise, TimeoutWithError } from "./timeoutUtils";
9
9
 
10
10
  /**
@@ -15,10 +15,10 @@ import { PromiseExecutor, timeoutPromise, TimeoutWithError } from "./timeoutUtil
15
15
  * - failOnContainerClose = true
16
16
  * - timeoutOptions.durationMs = 1s
17
17
  */
18
- export async function ensureContainerConnected(container: Container): Promise<void> {
19
- if (!container.connected) {
20
- return timeoutPromise((resolve) => container.once("connected", () => resolve()));
21
- }
18
+ export async function ensureContainerConnected(container: IContainer): Promise<void> {
19
+ if (container.connectionState !== ConnectionState.Connected) {
20
+ return timeoutPromise((resolve) => container.once("connected", () => resolve()));
21
+ }
22
22
  }
23
23
 
24
24
  /**
@@ -42,18 +42,20 @@ export async function ensureContainerConnected(container: Container): Promise<vo
42
42
  * timeoutOptions.durationMs (which defaults to 250ms if left undefined).
43
43
  */
44
44
  export async function waitForContainerConnection(
45
- container: IContainer,
46
- failOnContainerClose: boolean = false,
47
- timeoutOptions?: TimeoutWithError): Promise<void> {
48
- if (container.connectionState !== ConnectionState.Connected) {
45
+ container: IContainer,
46
+ failOnContainerClose: boolean = false,
47
+ timeoutOptions?: TimeoutWithError,
48
+ ): Promise<void> {
49
+ if (container.connectionState !== ConnectionState.Connected) {
50
+ const executor: PromiseExecutor = (resolve, reject) => {
51
+ container.once("connected", () => resolve());
52
+ if (failOnContainerClose) {
53
+ container.once("closed", (error) => reject(error));
54
+ }
55
+ };
49
56
 
50
- const executor: PromiseExecutor = (resolve, reject) => {
51
- container.once("connected", () => resolve())
52
- if (failOnContainerClose) {
53
- container.once("closed", (error) => reject(error));
54
- }
55
- };
56
-
57
- return timeoutOptions === undefined ? new Promise(executor) : timeoutPromise(executor, timeoutOptions);
58
- }
57
+ return timeoutOptions === undefined
58
+ ? new Promise(executor)
59
+ : timeoutPromise(executor, timeoutOptions);
60
+ }
59
61
  }
package/src/index.ts CHANGED
@@ -3,39 +3,38 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- export { wrapDocumentService, wrapDocumentServiceFactory, wrapDocumentStorageService } from "./DriverWrappers";
6
+ export {
7
+ wrapDocumentService,
8
+ wrapDocumentServiceFactory,
9
+ wrapDocumentStorageService,
10
+ } from "./DriverWrappers";
7
11
  export { IProvideTestFluidObject, ITestFluidObject } from "./interfaces";
8
12
  export { LoaderContainerTracker } from "./loaderContainerTracker";
9
13
  export { fluidEntryPoint, LocalCodeLoader, SupportedExportInterfaces } from "./localCodeLoader";
10
14
  export { createAndAttachContainer, createLoader } from "./localLoader";
11
15
  export { retryWithEventualValue } from "./retry";
12
16
  export { mockConfigProvider } from "./TestConfigs";
13
- export { createTestContainerRuntimeFactory, TestContainerRuntimeFactory } from "./testContainerRuntimeFactory";
17
+ export {
18
+ createTestContainerRuntimeFactory,
19
+ TestContainerRuntimeFactory,
20
+ } from "./testContainerRuntimeFactory";
14
21
  export { ChannelFactoryRegistry, TestFluidObject, TestFluidObjectFactory } from "./testFluidObject";
15
22
  export {
16
- createDocumentId,
17
- DataObjectFactoryType,
18
- EventAndErrorTrackingLogger,
19
- getUnexpectedLogErrorException,
20
- IOpProcessingController,
21
- ITestContainerConfig,
22
- ITestObjectProvider,
23
- TestObjectProvider,
23
+ createDocumentId,
24
+ DataObjectFactoryType,
25
+ EventAndErrorTrackingLogger,
26
+ getUnexpectedLogErrorException,
27
+ IOpProcessingController,
28
+ ITestContainerConfig,
29
+ ITestObjectProvider,
30
+ TestObjectProvider,
24
31
  } from "./testObjectProvider";
32
+ export { createSummarizer, createSummarizerFromFactory, summarizeNow } from "./TestSummaryUtils";
25
33
  export {
26
- createSummarizer,
27
- createSummarizerFromFactory,
28
- createSummarizerWithContainer,
29
- summarizeNow,
30
- } from "./TestSummaryUtils";
31
- export {
32
- defaultTimeoutDurationMs,
33
- timeoutAwait,
34
- timeoutPromise,
35
- TimeoutWithError,
36
- TimeoutWithValue,
34
+ defaultTimeoutDurationMs,
35
+ timeoutAwait,
36
+ timeoutPromise,
37
+ TimeoutWithError,
38
+ TimeoutWithValue,
37
39
  } from "./timeoutUtils";
38
- export {
39
- ensureContainerConnected,
40
- waitForContainerConnection,
41
- } from "./containerUtils";
40
+ export { ensureContainerConnected, waitForContainerConnection } from "./containerUtils";
package/src/interfaces.ts CHANGED
@@ -5,17 +5,20 @@
5
5
 
6
6
  import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
7
7
  import { ISharedMap } from "@fluidframework/map";
8
- import { IFluidDataStoreContext, IFluidDataStoreChannel } from "@fluidframework/runtime-definitions";
8
+ import {
9
+ IFluidDataStoreContext,
10
+ IFluidDataStoreChannel,
11
+ } from "@fluidframework/runtime-definitions";
9
12
  import { IFluidLoadable } from "@fluidframework/core-interfaces";
10
13
 
11
14
  export interface IProvideTestFluidObject {
12
- readonly ITestFluidObject: ITestFluidObject;
15
+ readonly ITestFluidObject: ITestFluidObject;
13
16
  }
14
17
 
15
18
  export interface ITestFluidObject extends IProvideTestFluidObject, IFluidLoadable {
16
- root: ISharedMap;
17
- readonly runtime: IFluidDataStoreRuntime;
18
- readonly channel: IFluidDataStoreChannel;
19
- readonly context: IFluidDataStoreContext;
20
- getSharedObject<T = any>(id: string): Promise<T>;
19
+ root: ISharedMap;
20
+ readonly runtime: IFluidDataStoreRuntime;
21
+ readonly channel: IFluidDataStoreChannel;
22
+ readonly context: IFluidDataStoreContext;
23
+ getSharedObject<T = any>(id: string): Promise<T>;
21
24
  }