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

feat(vitest): add vitest cleanup export #294

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

mcous
Copy link
Collaborator

@mcous mcous commented Jan 26, 2024

Overview

This is the first PR in a series to add multiple Svelte versions and test runners to our CI test matrix.

  1. feat(vitest): add vitest cleanup export #294 <-- you are here
  2. ci: test against svelte v3 and v4 #295
  3. TODO add multiple Vitest environments to CI matrix
  4. TODO add Jest to CI matrix

Change log

This PR concentrates on getting Vitest fully working, since there are a few issues with the setup

  • Add @testing-library/svelte/vitest import, inspired by @testing-library/jest-dom/vitest to run auto-cleanup when using Vitest in non-global mode
    • Will require a docs update at some point
  • Upgrade testing-library/jest-dom so we can use @testing-library/jest-dom/vitest
  • Fix test scripts for watch mode and snapshot updates, which were still written with jest arguments
  • Fix Vitest coverage reports, which were not being generated in CI

Review requests

I'm keeping this PR in draft mode until I can verify that the @testing-library/svelte/vitest import works in a real project. Importing vitest in library code has given me issues before, so I want to verify before this is merged/released. It definitely works for our own test suite, though! Verified, works like a charm

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed / moved this file to avoid confusion with the src/vitest.js entrypoint

@mcous mcous changed the title feat(vitest): add vitest cleanup import feat(vitest): add vitest cleanup export Jan 26, 2024
@mcous mcous marked this pull request as ready for review January 27, 2024 10:34
@yanick yanick merged commit ee1b1f7 into testing-library:main Jan 27, 2024
6 checks passed
Copy link

🎉 This PR is included in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants