Skip to content

Commit

Permalink
Fix check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Aug 6, 2024
1 parent b2548f7 commit fb56f61
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const docsRenderer = {
render: vi.fn().mockImplementation((context, parameters, element) => Promise.resolve()),
unmount: vi.fn(),
};
export const teardownrenderToCanvas: Mock<[TeardownRenderToCanvas]> = vi.fn();
export const teardownrenderToCanvas: Mock<(teardown: TeardownRenderToCanvas) => void> = vi.fn();
const rawProjectAnnotations = {
initialGlobals: { a: 'b' },
globalTypes: {},
Expand Down
8 changes: 2 additions & 6 deletions code/renderers/react/src/public-types.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,11 @@ it('Infer mock function given to args in meta.', () => {
play: async ({ args, mount }) => {
const canvas = await mount(<TestButton {...args} />);
expectTypeOf(canvas).toEqualTypeOf<Canvas>();
expectTypeOf(args.onClick).toEqualTypeOf<Mock<[], void>>();
expectTypeOf(args.onClick).toEqualTypeOf<Mock>();
expectTypeOf(args.onRender).toEqualTypeOf<() => JSX.Element>();
},
};
type Expected = StoryAnnotations<
ReactRenderer,
Props & { onClick: Mock<[], void> },
Partial<Props>
>;
type Expected = StoryAnnotations<ReactRenderer, Props & { onClick: Mock }, Partial<Props>>;

expectTypeOf(Basic).toEqualTypeOf<Expected>();
});
9 changes: 8 additions & 1 deletion code/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { coverageConfigDefaults, defineConfig } from 'vitest/config';
export default defineConfig({
test: {
coverage: {
exclude: [...coverageConfigDefaults.exclude, '**/dist/**', ''],
exclude: [
...coverageConfigDefaults.exclude,
'**/__mocks/**',
'**/dist/**',
'playwright.config.ts',
'vitest-setup.ts',
'vitest.helpers.ts',
],
},
},
});

0 comments on commit fb56f61

Please sign in to comment.