Skip to content

Commit 83e32c9

Browse files
committed
test(metadata): the spec/kernel mock keeps the real module beside the narrowed type registry
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pevHhCDHNc3eWbkAg
1 parent e72efa0 commit 83e32c9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/metadata/src/metadata.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,11 @@ describe('MetadataPlugin', () => {
548548
});
549549

550550
// Mock the spec kernel import
551-
vi.mock('@objectstack/spec/kernel', () => ({
551+
// The rest of the module is the real one: the artifact door judges a body's
552+
// `_packageId` through `judgeCollectionItemOwnerStamp` over
553+
// `OWNER_STAMP_JUDGED_COLLECTIONS` (#28697), and only the type registry is narrowed here.
554+
vi.mock('@objectstack/spec/kernel', async (importOriginal) => ({
555+
...(await importOriginal<typeof import('@objectstack/spec/kernel')>()),
552556
DEFAULT_METADATA_TYPE_REGISTRY: [
553557
{ type: 'object', label: 'Object', filePatterns: ['**/*.object.ts'], supportsOverlay: true, allowRuntimeCreate: false, supportsVersioning: true, loadOrder: 10, domain: 'data' },
554558
{ type: 'view', label: 'View', filePatterns: ['**/*.view.ts'], supportsOverlay: true, allowRuntimeCreate: true, supportsVersioning: false, loadOrder: 50, domain: 'ui' },

0 commit comments

Comments
 (0)