Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Map and Directory Fuzz Models #23754

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/dds/map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./internal/test": {
"allow-ff-test-exports": {
"import": {
"types": "./lib/test/index.d.ts",
"default": "./lib/test/index.js"
},
"require": {
"types": "./dist/test/index.d.ts",
"default": "./dist/test/index.js"
}
}
}
},
"main": "lib/index.js",
Expand All @@ -62,7 +74,7 @@
"build:test": "npm run build:test:esm && npm run build:test:cjs",
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
"check:are-the-types-wrong": "attw --pack .",
"check:are-the-types-wrong": "attw --pack . --exclude-entrypoints ./internal/test",
"check:biome": "biome check .",
"check:exports": "concurrently \"npm:check:exports:*\"",
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
Expand Down
6 changes: 6 additions & 0 deletions packages/dds/map/src/test/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/

export { baseDirModel, baseMapModel } from "./mocha/index.js";
14 changes: 9 additions & 5 deletions packages/dds/map/src/test/mocha/directoryEquivalenceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { strict as assert } from "node:assert";

import { isObject } from "@fluidframework/core-utils/internal";
import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
import { isFluidHandle, toFluidHandleInternal } from "@fluidframework/runtime-utils/internal";

import type { IDirectory } from "../../interfaces.js";

Expand Down Expand Up @@ -47,8 +47,12 @@ async function assertEventualConsistencyCore(
isObject(secondVal),
`Values differ at key ${key}: first is an object, second is not`,
);
const firstHandle = isFluidHandle(firstVal) ? await firstVal.get() : firstVal;
const secondHandle = isFluidHandle(secondVal) ? await secondVal.get() : secondVal;
const firstHandle = isFluidHandle(firstVal)
? toFluidHandleInternal(firstVal).absolutePath
: firstVal;
const secondHandle = isFluidHandle(secondVal)
? toFluidHandleInternal(secondVal).absolutePath
: secondVal;
assert.equal(
firstHandle,
secondHandle,
Expand All @@ -59,8 +63,8 @@ async function assertEventualConsistencyCore(
);
} else {
assert.strictEqual(
first.get(key),
second.get(key),
firstVal,
secondVal,
`Key not found or value not matching ` +
`key: ${key}, value in dir first at path ${first.absolutePath}: ${first.get(
key,
Expand Down
Loading
Loading