Skip to content

Fix TS na Vitest issues#477

Merged
bvaughn merged 4 commits into
bvaughn:jest-to-vitestfrom
Andarist:fix/setup
May 1, 2025
Merged

Fix TS na Vitest issues#477
bvaughn merged 4 commits into
bvaughn:jest-to-vitestfrom
Andarist:fix/setup

Conversation

@Andarist
Copy link
Copy Markdown
Contributor

@Andarist Andarist commented May 1, 2025

builds on top of #476

@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-resizable-panels ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 1, 2025 6:11pm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it ends up being easier to handle this with a dedicated Vitest config so a single config doesn't have to pretend to be a server at times and then to be a browser at different times.

Comment thread packages/react-resizable-panels/package.json Outdated
});

test("should throw if default size is less than 0 or greater than 100", () => {
test.skip("should throw if default size is less than 0 or greater than 100", () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this runs into some infinite loop or smth and makes the test hang - I'm still investigating what's up with this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so this version pass:

    test("should throw if default size is less than 0 or greater than 100", () => {
      expectWarning(
        "Invalid layout total size: -1%. Layout normalization will be applied."
      );
      expectWarning("default size should not be less than 0");

      act(() => {
        root.render(
          <PanelGroup direction="horizontal">
            <Panel defaultSize={-1} />
          </PanelGroup>
        );
      });

      act(() => {
        root.render(
          <PanelGroup direction="horizontal">
            <Panel defaultSize={101} />
          </PanelGroup>
        );
      });
    });

but clearly it doesn't do what the test title says. So something is off here and has to be fixed - I'll leave that to you ;p

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me when I uncommented the skip 🤷🏼

Copy link
Copy Markdown
Owner

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Thanks!

@bvaughn bvaughn merged commit cc84463 into bvaughn:jest-to-vitest May 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants