Skip to content

Commit 5ad759e

Browse files
claude[bot]claude
andcommitted
test(core): type the pin-test plugin metadata instead of casting it
`PluginMetadata` requires `init`, so the object-literal `as` casts tripped TS2352 under `tsconfig.test.json`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
1 parent b52b5cd commit 5ad759e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

packages/core/src/kernel.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,27 +623,31 @@ describe('ObjectKernel', () => {
623623
startPluginWithTimeout(p: PluginMetadata): Promise<PluginStartupResult>;
624624
}).startPluginWithTimeout(meta);
625625

626-
const ok = await callStart({
626+
const okMeta: PluginMetadata = {
627627
name: 'ok-plugin',
628628
version: '1.0.0',
629+
init: async () => {},
629630
start: async () => {
630631
await new Promise(resolve => setTimeout(resolve, 20));
631632
},
632-
} as PluginMetadata);
633+
};
634+
const ok = await callStart(okMeta);
633635

634636
expect(ok.success).toBe(true);
635637
expect(ok.duration).toBeGreaterThan(0);
636638
expect(ok.duration).toBeLessThan(INSTANT_FLOOR_MS);
637639
// The deprecated alias carries the same elapsed value, not an instant.
638640
expect(ok.startTime).toBe(ok.duration);
639641

640-
const failed = await callStart({
642+
const failingMeta: PluginMetadata = {
641643
name: 'failing-plugin',
642644
version: '1.0.0',
645+
init: async () => {},
643646
start: async () => {
644647
throw new Error('boom');
645648
},
646-
} as PluginMetadata);
649+
};
650+
const failed = await callStart(failingMeta);
647651

648652
expect(failed.success).toBe(false);
649653
expect(failed.duration).toBeGreaterThanOrEqual(0);

0 commit comments

Comments
 (0)