Skip to content

Commit fbcf5f0

Browse files
morinokamiclaude
andcommitted
test(env): check that the env registry publishes a function
The test that the copy of `void/env` registering a schema publishes its `_prepareEnv` compared the registry's entry with that copy's export. Without `_prepareEnv`, both are undefined, so the test passed without the change it covers. It now also checks that the entry is a function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 6eb218b commit fbcf5f0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎packages/void/test/unit/env-schema.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ describe('several copies of void/env in one Worker', () => {
827827
it('publishes the _prepareEnv of the copy that registered the schema', async () => {
828828
const copy = await secondCopy();
829829
defineEnv({ KEY: string() });
830+
expect(registry()?.prepare).toBeTypeOf('function');
830831
expect(registry()?.prepare).toBe(_prepareEnv);
831832
copy.defineEnv({ KEY: string() });
832833
expect(registry()?.prepare).toBe(copy._prepareEnv);

0 commit comments

Comments
 (0)