Skip to content
Prev Previous commit
Next Next commit
try to fix flake
  • Loading branch information
yannbf committed Nov 13, 2025
commit 6935742708a6e18da64e664c67a8943f9ccf46f9
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@
};

export default { component: Button };
`;
const transformed = getTransformed(source);
`.replace(/\r\n/g, '\n');

const transformed = getTransformed(source).replace(/\r\n/g, '\n');
expect(getDiff(source, transformed)).toMatchInlineSnapshot(`
import { Button } from './Button';

Expand Down Expand Up @@ -114,6 +115,6 @@

const transformed = getTransformed(source);

expect(transformed).toEqual(source);

Check failure on line 118 in code/lib/cli-storybook/src/codemod/helpers/remove-unused-types.test.ts

View workflow job for this annotation

GitHub Actions / Core Unit Tests, windows-latest

src/codemod/helpers/remove-unused-types.test.ts > removeUnusedTypes > should not remove used Storybook types

AssertionError: expected '// Nothing in this file should be rem…' to deeply equal '// Nothing in this file should be rem…' - Expected + Received - // Nothing in this file should be removed or modified + // Nothing in this file should be removed or modified - import { StoryFn, StoryObj, ComponentStory, Meta, MetaObj, ComponentMeta } from '@storybook/react'; + import { StoryFn, StoryObj, ComponentStory, Meta, MetaObj, ComponentMeta } from '@storybook/react'; - import { Button } from './Button'; - + import { Button } from './Button'; + - type Alias = StoryFn<typeof Button>; + type Alias = StoryFn<typeof Button>; - type Alias2 = Alias & { b: string }; + type Alias2 = Alias & { b: string }; - type Story = StoryObj & { a: string }; + type Story = StoryObj & { a: string }; - type DeepType = { + type DeepType = { - foo: { + foo: { - bar: { + bar: { - story: ComponentStory<typeof Button>; + story: ComponentStory<typeof Button>; - } + } - } + } - }; + }; - interface Interface extends Meta {} + interface Interface extends Meta {} - interface DeepInterface { + interface DeepInterface { - baz: { + baz: { - qux: { + qux: { - meta: MetaObj<typeof Button>; + meta: MetaObj<typeof Button>; - } + } - } + } - }; + }; - const X: ComponentMeta = {} - + const X: ComponentMeta = {} + - function foo(a: Story, c: DeepType, d: Interface, e: DeepInterface){} - + function foo(a: Story, c: DeepType, d: Interface, e: DeepInterface){} + export default {}; ❯ src/codemod/helpers/remove-unused-types.test.ts:118:25
});
});
Loading