chore: les dix injections de useShape passent par le faux partage

Dix sites, pas les deux que le suivi annoncait : `(() => {}) as unknown as
UseShapeLike` survivait la ou le type etait encore `any` et ou le cast ne
disait donc rien. Ils prennent le faux partage, sans cast.
This commit is contained in:
Sylvain Duchesne
2026-09-24 19:00:25 +02:00
parent c5de1cea35
commit d4b392a119
6 changed files with 16 additions and 10 deletions
+3 -2
View File
@@ -22,6 +22,7 @@
* another's document is decided by the system rather than by a variable in this file.
*/
import { test, expect, mock, afterEach } from "bun:test";
import { makeUseShapeHook } from "./use-shape-fake";
import { configure, getObjects, insertObject, initNg, storeRegistry } from "../src/index";
import { makeNg } from "../src/surface/ng-proxy";
import {
@@ -179,7 +180,7 @@ function inject(orm?: OrmDouble) {
const ng = makeFakeNg();
configure({
ng: ng as unknown as NgLike,
useShape: (() => {}) as unknown as UseShapeLike,
useShape: makeUseShapeHook().hook,
...(orm ? { getObjects: orm.getObjects, insertObject: orm.insertObject } : {}),
});
configureStoreRegistry({ getSession: async () => SESSION });
@@ -397,7 +398,7 @@ test("initNg hands the ORM this package's wrapped ng, not the argument", async (
const raw = { marker: "the raw SDK object" };
configure({
ng: ng as unknown as NgLike,
useShape: (() => {}) as unknown as UseShapeLike,
useShape: makeUseShapeHook().hook,
initNg: (...a: unknown[]) => void seen.push(...a),
});
configureStoreRegistry({ getSession: async () => SESSION });