chore: test with the extension tester

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-08-01 12:06:16 +02:00
parent 8d63177346
commit 4f446c44f6
@@ -695,7 +695,7 @@ describe('createExtension', () => {
const overriden = testExtension.override({
config: {
schema: {
bar: z => z.string().optional(),
bar: z => z.string().default('hello'),
},
},
factory(originalFactory, { config }) {
@@ -707,7 +707,15 @@ describe('createExtension', () => {
},
});
const tester = createExtensionTester(overriden).render();
expect(createExtensionTester(overriden).data(stringDataRef)).toBe(
'foo-boom-override-hello',
);
expect(
createExtensionTester(overriden, {
config: { foo: 'hello', bar: 'world' },
}).data(stringDataRef),
).toBe('foo-hello-override-world');
});
});
});