@fluid-experimental/tree 0.59.3001 → 0.59.4000-71128
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/Forest.js +1 -1
- package/dist/Forest.js.map +1 -1
- package/dist/id-compressor/IdCompressor.d.ts +19 -45
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
- package/dist/id-compressor/IdCompressor.js +151 -151
- package/dist/id-compressor/IdCompressor.js.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.d.ts +1 -16
- package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/dist/id-compressor/SessionIdNormalizer.js +23 -21
- package/dist/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/dist/id-compressor/persisted-types/0.0.1.d.ts +23 -4
- package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
- package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -1
- package/lib/Forest.js +1 -1
- package/lib/Forest.js.map +1 -1
- package/lib/id-compressor/IdCompressor.d.ts +19 -45
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
- package/lib/id-compressor/IdCompressor.js +152 -152
- package/lib/id-compressor/IdCompressor.js.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.d.ts +1 -16
- package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
- package/lib/id-compressor/SessionIdNormalizer.js +23 -21
- package/lib/id-compressor/SessionIdNormalizer.js.map +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.d.ts +23 -4
- package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -1
- package/lib/test/IdCompressor.perf.tests.js +47 -67
- package/lib/test/IdCompressor.perf.tests.js.map +1 -1
- package/lib/test/IdCompressor.tests.js +196 -101
- package/lib/test/IdCompressor.tests.js.map +1 -1
- package/lib/test/Summary.tests.d.ts +0 -1
- package/lib/test/Summary.tests.d.ts.map +1 -1
- package/lib/test/Summary.tests.js +0 -3
- package/lib/test/Summary.tests.js.map +1 -1
- package/lib/test/Virtualization.tests.js +0 -4
- package/lib/test/Virtualization.tests.js.map +1 -1
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +14 -7
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -1
- package/lib/test/utilities/IdCompressorTestUtilities.js +40 -20
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -1
- package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
- package/lib/test/utilities/SharedTreeTests.js +0 -1
- package/lib/test/utilities/SharedTreeTests.js.map +1 -1
- package/lib/test/utilities/SummaryLoadPerfTests.js +1 -1
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -1
- package/lib/test/utilities/TestCommon.d.ts +4 -0
- package/lib/test/utilities/TestCommon.d.ts.map +1 -1
- package/lib/test/utilities/TestCommon.js +6 -0
- package/lib/test/utilities/TestCommon.js.map +1 -1
- package/package.json +24 -19
- package/src/Forest.ts +1 -1
- package/src/id-compressor/IdCompressor.ts +171 -198
- package/src/id-compressor/SessionIdNormalizer.ts +29 -41
- package/src/id-compressor/persisted-types/0.0.1.ts +25 -4
|
@@ -9,9 +9,9 @@ import { benchmark, BenchmarkType } from '@fluid-tools/benchmark';
|
|
|
9
9
|
import { WriteFormat } from '../../persisted-types';
|
|
10
10
|
import { performFuzzActions } from '../fuzz/SharedTreeFuzzTests';
|
|
11
11
|
import { makeOpGenerator } from '../fuzz/Generators';
|
|
12
|
-
import { expectAssert } from '../Summary.tests';
|
|
13
12
|
import { areRevisionViewsSemanticallyEqual } from '../../EditUtilities';
|
|
14
13
|
import { setUpLocalServerTestSharedTree, setUpTestSharedTree, testDocumentsPathBase } from './TestUtilities';
|
|
14
|
+
import { expectAssert } from './TestCommon';
|
|
15
15
|
const directory = join(testDocumentsPathBase, 'summary-load-perf-tests');
|
|
16
16
|
/**
|
|
17
17
|
* Runs a test suite for summary load perf on `SharedTree`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SummaryLoadPerfTests.js","sourceRoot":"","sources":["../../../src/test/utilities/SummaryLoadPerfTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SummaryLoadPerfTests.js","sourceRoot":"","sources":["../../../src/test/utilities/SummaryLoadPerfTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,SAAS,GAAG,IAAI,CAAC,qBAAqB,EAAE,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E,MAAM,4BAA4B,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACpE,MAAM,0BAA0B,GAAG,QAAQ,CAAC,+BAA+B,CAAC,CAAC;IAE7E,gHAAgH;IAChH,0EAA0E;IAC1E,kHAAkH;IAClH,wDAAwD;IAExD,OAAO;QACN,4BAA4B;QAC5B,0BAA0B;QAC1B,4BAA4B;QAC5B,0BAA0B;KAC1B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { join } from 'path';\nimport * as fs from 'fs';\nimport { takeAsync } from '@fluid-internal/stochastic-test-utils';\nimport { benchmark, BenchmarkType } from '@fluid-tools/benchmark';\nimport { SharedTree } from '../../SharedTree';\nimport { WriteFormat } from '../../persisted-types';\nimport { performFuzzActions } from '../fuzz/SharedTreeFuzzTests';\nimport { makeOpGenerator } from '../fuzz/Generators';\nimport { areRevisionViewsSemanticallyEqual } from '../../EditUtilities';\nimport { setUpLocalServerTestSharedTree, setUpTestSharedTree, testDocumentsPathBase } from './TestUtilities';\nimport { expectAssert } from './TestCommon';\n\nconst directory = join(testDocumentsPathBase, 'summary-load-perf-tests');\n\n/**\n * Runs a test suite for summary load perf on `SharedTree`.\n * This suite can be used to test other implementations that aim to fulfill `SharedTree`'s contract.\n */\nexport function runSummaryLoadPerfTests(title: string): void {\n\tdescribe(title, () => {\n\t\t// Re-enable this test for an easy way to write the test summary files to disk\n\t\tit.skip('save files to disk', async () => {\n\t\t\tawait writeSummaryTestTrees();\n\t\t});\n\n\t\tconst {\n\t\t\tsummaryFileWithHistory_0_0_2,\n\t\t\tsummaryFileNoHistory_0_0_2,\n\t\t\tsummaryFileWithHistory_0_1_1,\n\t\t\tsummaryFileNoHistory_0_1_1,\n\t\t\t// blobsFile: string;\n\t\t} = loadSummaryTestFiles();\n\n\t\tconst tests = [\n\t\t\t{ title: 'load 0.0.2 format without history', file: summaryFileNoHistory_0_0_2 },\n\t\t\t{ title: 'load 0.0.2 format with history', file: summaryFileWithHistory_0_0_2 },\n\t\t\t{ title: 'load 0.1.1 format without history', file: summaryFileNoHistory_0_1_1 },\n\t\t\t{ title: 'load 0.1.1 format with history', file: summaryFileWithHistory_0_1_1 },\n\t\t];\n\n\t\tfor (const { title, file } of tests) {\n\t\t\tbenchmark({\n\t\t\t\ttype: BenchmarkType.Measurement,\n\t\t\t\ttitle,\n\t\t\t\tbenchmarkFn: () => {\n\t\t\t\t\tconst { tree } = setUpTestSharedTree({ writeFormat: WriteFormat.v0_0_2 });\n\t\t\t\t\ttree.loadSerializedSummary(file);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t});\n}\n\nasync function generateRandomTree(\n\tseed: number,\n\tmaxTreeSize: number,\n\twriteFormat: WriteFormat,\n\tsummarizeHistory: boolean\n): Promise<SharedTree> {\n\tconst generator = takeAsync(\n\t\t1000,\n\t\tmakeOpGenerator({\n\t\t\teditConfig: { maxTreeSize },\n\t\t\tjoinConfig: {\n\t\t\t\twriteFormat: [writeFormat],\n\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\tmaximumActiveCollaborators: 2,\n\t\t\t\tmaximumPassiveCollaborators: 0,\n\t\t\t},\n\t\t})\n\t);\n\tconst { testObjectProvider } = await performFuzzActions(generator, seed, true);\n\tconst { tree: finalTree } = await setUpLocalServerTestSharedTree({\n\t\ttestObjectProvider,\n\t\tsummarizeHistory,\n\t\twriteFormat,\n\t});\n\tawait testObjectProvider.ensureSynchronized();\n\treturn finalTree;\n}\n\nasync function writeSummaryTestTrees(): Promise<void> {\n\tif (!fs.existsSync(directory)) {\n\t\tfs.mkdirSync(directory);\n\t}\n\n\tconst seed = 24601;\n\tconst tree002 = await generateRandomTree(seed, 1000, WriteFormat.v0_0_2, true);\n\tconst tree011 = await generateRandomTree(seed, 1000, WriteFormat.v0_1_1, true);\n\tconst tree002NoHistory = await generateRandomTree(seed, 1000, WriteFormat.v0_0_2, false);\n\tconst tree011NoHistory = await generateRandomTree(seed, 1000, WriteFormat.v0_1_1, false);\n\n\texpectAssert(areRevisionViewsSemanticallyEqual(tree002.currentView, tree002, tree011.currentView, tree011));\n\texpectAssert(\n\t\tareRevisionViewsSemanticallyEqual(tree002.currentView, tree002, tree002NoHistory.currentView, tree002NoHistory)\n\t);\n\texpectAssert(\n\t\tareRevisionViewsSemanticallyEqual(tree011.currentView, tree011, tree011NoHistory.currentView, tree011NoHistory)\n\t);\n\tconst { promises: fsP } = fs;\n\tawait fsP.writeFile(join(directory, 'summary-0-0-2.json'), tree002.saveSerializedSummary());\n\tawait fsP.writeFile(join(directory, 'summary-0-1-1.json'), tree011.saveSerializedSummary());\n\tawait fsP.writeFile(join(directory, 'summary-no-history-0-0-2.json'), tree002NoHistory.saveSerializedSummary());\n\tawait fsP.writeFile(join(directory, 'summary-no-history-0-1-1.json'), tree011NoHistory.saveSerializedSummary());\n}\n\nfunction loadSummaryTestFiles(): {\n\tsummaryFileWithHistory_0_0_2: string;\n\tsummaryFileNoHistory_0_0_2: string;\n\tsummaryFileWithHistory_0_1_1: string;\n\tsummaryFileNoHistory_0_1_1: string;\n} {\n\tconst readFile = (name: string): string => {\n\t\tconst contents = fs.readFileSync(join(directory, name), 'utf-8');\n\t\t// Round-trip the file so that performance testing summary doesn't require parsing unnecessary/unrealistic whitespace\n\t\treturn JSON.stringify(JSON.parse(contents));\n\t};\n\tconst summaryFileWithHistory_0_0_2 = readFile('summary-0-0-2.json');\n\tconst summaryFileNoHistory_0_0_2 = readFile('summary-no-history-0-0-2.json');\n\tconst summaryFileWithHistory_0_1_1 = readFile('summary-0-1-1.json');\n\tconst summaryFileNoHistory_0_1_1 = readFile('summary-no-history-0-1-1.json');\n\n\t// Note: We don't bother writing/reading a \"blobs\" file for this test suite because loading a serialized summary\n\t// with history should never involve attempting to get any of those blobs.\n\t// This *is* a fair comparison from a perf perspective b/c the whole point of chunking edit history is to decrease\n\t// summary size for potentially unused edit information.\n\n\treturn {\n\t\tsummaryFileWithHistory_0_0_2,\n\t\tsummaryFileNoHistory_0_0_2,\n\t\tsummaryFileWithHistory_0_1_1,\n\t\tsummaryFileNoHistory_0_1_1,\n\t};\n}\n"]}
|
|
@@ -6,4 +6,8 @@
|
|
|
6
6
|
* Check if the given value is defined using mocha's `expect`. Return the defined value;
|
|
7
7
|
*/
|
|
8
8
|
export declare function expectDefined<T>(value: T | undefined): T;
|
|
9
|
+
/**
|
|
10
|
+
* Expects `condition` and applies a type assertion.
|
|
11
|
+
*/
|
|
12
|
+
export declare function expectAssert(condition: unknown, message?: string): asserts condition;
|
|
9
13
|
//# sourceMappingURL=TestCommon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestCommon.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/TestCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAGxD"}
|
|
1
|
+
{"version":3,"file":"TestCommon.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/TestCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAGxD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAEpF"}
|
|
@@ -10,4 +10,10 @@ export function expectDefined(value) {
|
|
|
10
10
|
expect(value).to.be.not.undefined;
|
|
11
11
|
return value;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Expects `condition` and applies a type assertion.
|
|
15
|
+
*/
|
|
16
|
+
export function expectAssert(condition, message) {
|
|
17
|
+
expect(condition, message);
|
|
18
|
+
}
|
|
13
19
|
//# sourceMappingURL=TestCommon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestCommon.js","sourceRoot":"","sources":["../../../src/test/utilities/TestCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,UAAU,aAAa,CAAI,KAAoB;IACpD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;IAClC,OAAO,KAAU,CAAC;AACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { expect } from 'chai';\n\n/**\n * Check if the given value is defined using mocha's `expect`. Return the defined value;\n */\nexport function expectDefined<T>(value: T | undefined): T {\n\texpect(value).to.be.not.undefined;\n\treturn value as T;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TestCommon.js","sourceRoot":"","sources":["../../../src/test/utilities/TestCommon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,UAAU,aAAa,CAAI,KAAoB;IACpD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;IAClC,OAAO,KAAU,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,SAAkB,EAAE,OAAgB;IAChE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { expect } from 'chai';\n\n/**\n * Check if the given value is defined using mocha's `expect`. Return the defined value;\n */\nexport function expectDefined<T>(value: T | undefined): T {\n\texpect(value).to.be.not.undefined;\n\treturn value as T;\n}\n\n/**\n * Expects `condition` and applies a type assertion.\n */\nexport function expectAssert(condition: unknown, message?: string): asserts condition {\n\texpect(condition, message);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/tree",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.4000-71128",
|
|
4
4
|
"description": "Distributed tree",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"eslint:fix": "eslint src --fix",
|
|
27
27
|
"lint": "npm run prettier && npm run eslint",
|
|
28
28
|
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
29
|
+
"perf": "cross-env FLUID_TEST_VERBOSE=1 mocha \"dist/**/*.tests.js\" --exit -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict --expose-gc --perfMode --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js --timeout 30000",
|
|
30
|
+
"perf:measure": "npm run perf -- --fgrep @Measurement",
|
|
29
31
|
"prettier": "prettier --check \"**/*.{js,json,jsx,md,ts,tsx,yml,yaml}\"",
|
|
30
32
|
"prettier:fix": "prettier --write \"**/*.{js,json,jsx,md,ts,tsx,yml,yaml}\"",
|
|
31
33
|
"test": "nyc npm run test:mocha",
|
|
@@ -36,13 +38,13 @@
|
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
38
40
|
"@fluidframework/common-utils": "^0.32.1",
|
|
39
|
-
"@fluidframework/container-definitions": "^0.48.
|
|
41
|
+
"@fluidframework/container-definitions": "^0.48.2000-0",
|
|
40
42
|
"@fluidframework/core-interfaces": "^0.43.1000",
|
|
41
|
-
"@fluidframework/datastore-definitions": "
|
|
42
|
-
"@fluidframework/protocol-definitions": "^0.1028.
|
|
43
|
-
"@fluidframework/runtime-definitions": "
|
|
44
|
-
"@fluidframework/shared-object-base": "
|
|
45
|
-
"@fluidframework/telemetry-utils": "
|
|
43
|
+
"@fluidframework/datastore-definitions": "0.59.4000-71128",
|
|
44
|
+
"@fluidframework/protocol-definitions": "^0.1028.2000-0",
|
|
45
|
+
"@fluidframework/runtime-definitions": "0.59.4000-71128",
|
|
46
|
+
"@fluidframework/shared-object-base": "0.59.4000-71128",
|
|
47
|
+
"@fluidframework/telemetry-utils": "0.59.4000-71128",
|
|
46
48
|
"buffer": "^6.0.3",
|
|
47
49
|
"denque": "^1.5.1",
|
|
48
50
|
"lru-cache": "^6.0.0",
|
|
@@ -50,22 +52,23 @@
|
|
|
50
52
|
"uuid": "^8.3.1"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"@fluid-internal/stochastic-test-utils": "
|
|
54
|
-
"@fluid-tools/benchmark": "^0.
|
|
55
|
+
"@fluid-internal/stochastic-test-utils": "0.59.4000-71128",
|
|
56
|
+
"@fluid-tools/benchmark": "^0.41.67945",
|
|
55
57
|
"@fluidframework/build-common": "^0.23.0",
|
|
56
|
-
"@fluidframework/container-loader": "
|
|
57
|
-
"@fluidframework/container-runtime": "
|
|
58
|
+
"@fluidframework/container-loader": "0.59.4000-71128",
|
|
59
|
+
"@fluidframework/container-runtime": "0.59.4000-71128",
|
|
58
60
|
"@fluidframework/eslint-config-fluid": "^0.28.2000",
|
|
59
|
-
"@fluidframework/mocha-test-setup": "
|
|
60
|
-
"@fluidframework/runtime-utils": "
|
|
61
|
-
"@fluidframework/test-driver-definitions": "
|
|
62
|
-
"@fluidframework/test-drivers": "
|
|
63
|
-
"@fluidframework/test-runtime-utils": "
|
|
64
|
-
"@fluidframework/test-utils": "
|
|
65
|
-
"@fluidframework/undo-redo": "
|
|
61
|
+
"@fluidframework/mocha-test-setup": "0.59.4000-71128",
|
|
62
|
+
"@fluidframework/runtime-utils": "0.59.4000-71128",
|
|
63
|
+
"@fluidframework/test-driver-definitions": "0.59.4000-71128",
|
|
64
|
+
"@fluidframework/test-drivers": "0.59.4000-71128",
|
|
65
|
+
"@fluidframework/test-runtime-utils": "0.59.4000-71128",
|
|
66
|
+
"@fluidframework/test-utils": "0.59.4000-71128",
|
|
67
|
+
"@fluidframework/undo-redo": "0.59.4000-71128",
|
|
66
68
|
"@microsoft/api-extractor": "^7.22.2",
|
|
67
69
|
"@rushstack/eslint-config": "^2.5.1",
|
|
68
70
|
"@types/lru-cache": "^5.1.0",
|
|
71
|
+
"@types/mocha": "^9.1.1",
|
|
69
72
|
"@types/random-js": "^1.0.31",
|
|
70
73
|
"@typescript-eslint/eslint-plugin": "~5.9.0",
|
|
71
74
|
"@typescript-eslint/parser": "~5.9.0",
|
|
@@ -79,12 +82,14 @@
|
|
|
79
82
|
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
80
83
|
"eslint-plugin-import": "~2.25.4",
|
|
81
84
|
"eslint-plugin-jest": "~26.1.3",
|
|
85
|
+
"eslint-plugin-jsdoc": "~39.3.0",
|
|
82
86
|
"eslint-plugin-mocha": "~10.0.3",
|
|
83
87
|
"eslint-plugin-promise": "~6.0.0",
|
|
84
88
|
"eslint-plugin-react": "~7.28.0",
|
|
85
89
|
"eslint-plugin-tsdoc": "~0.2.14",
|
|
86
90
|
"eslint-plugin-unicorn": "~40.0.0",
|
|
87
|
-
"
|
|
91
|
+
"eslint-plugin-unused-imports": "~2.0.0",
|
|
92
|
+
"mocha": "^10.0.0",
|
|
88
93
|
"nyc": "^15.0.0",
|
|
89
94
|
"prettier": "^2.3.1",
|
|
90
95
|
"random-js": "^1.0.8",
|
package/src/Forest.ts
CHANGED
|
@@ -401,7 +401,7 @@ export class Forest {
|
|
|
401
401
|
const parent = this.get(node.parentId);
|
|
402
402
|
const trait = parent.traits.get(node.traitParent);
|
|
403
403
|
assert(trait !== undefined);
|
|
404
|
-
assert(trait.
|
|
404
|
+
assert(trait.includes(node.identifier), 'node is parented incorrectly');
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
for (const trait of node.traits.values()) {
|