Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: with-vitest example broken after upgrading @testing-library/jest-dom (partial fix included) #1044

Closed
2 tasks done
peterhirn opened this issue Sep 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@peterhirn
Copy link

peterhirn commented Sep 3, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

After upgrading @testing-library/jest-dom to >= v6 the tests fail with some package lookup error.

I fixed the problem here https://github.com/peterhirn/solid-start-with-vitest, starting from the with-vitest example.

If you think my fixes are good I can squash them and open a PR to patch examples/with-vitest (I didn't test the non-Typescript variant yet, not sure if even relevant anymore).

I also switched from @vitest/coverage-c8 to @vitest/coverage-v8 (c8 is deprecated)

Aggregated changes: https://github.com/peterhirn/solid-start-with-vitest/compare/6a6cc3c017272381c1305b582d350dae48e7782d..master

Update

I just realized there is still a import problem when using <Routes>. After adding this example test from https://github.com/solidjs/solid-testing-library

  it("uses params", async () => {
    const App = () => (
      <Routes>
        <Route path="/ids/:id" component={() => <p>Id: {useParams()?.id}</p>} />
        <Route path="/" component={() => <p>Start</p>} />
      </Routes>
    );
    const { findByText } = render(() => <App />, { location: "ids/1234" });
    expect(await findByText("Id: 1234")).not.toBeFalsy();
  });

the tests fail with

Error: Cannot find module 'C:\my-app-vitest\node_modules\.pnpm\@[email protected][email protected]\node_modules\@solidjs\router\dist\integration' imported from C:\my-app-vitest\node_modules\.pnpm\@[email protected][email protected]\node_modules\@solidjs\router\dist\routing.js

Update 2

I added two more very simple tests for <Home/> and <PageNotFound />. Unfortunately the latter tries to pull @solidjs/router and fails. I don't know how to proceed here.

I'm also very confused by the vitest setting deps.optimizer.web.include.

  • when removed all tests fail
  • when removing only the include part I get warnings about "multiple instances of Solid", but tests still pass
  • the content of include seems to be irrelevant, eg. this still works without any warnings
    deps: {
      optimizer: {
        web: {
          include: [],
        },
      },
    },

Update 3 (2023-09-23)

Ryan mentioned on his stream yesterday that he's working on rebasing all examples on vinxi. This issue might be obsolete soon.

Context 🔦

No response

Your environment 🌎

No response

@peterhirn peterhirn added the bug Something isn't working label Sep 3, 2023
@peterhirn peterhirn changed the title [Bug?]: with-vitest example broken after upgrading @testing-library/jest-dom (fix included) [Bug?]: with-vitest example broken after upgrading @testing-library/jest-dom (partial fix included) Sep 3, 2023
@ryansolid
Copy link
Member

In setting up for SolidStart's next Beta Phase built on Nitro and Vinxi we are closing all PRs/Issues that will not be merged due to the system changing. If you feel your issue was closed by mistake. Feel free to re-open it after updating/testing against 0.4.x release. Thank you for your patience.

See #1139 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants