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

test: add simple typing tests #298

Merged
merged 5 commits into from
Feb 1, 2024
Merged

test: add simple typing tests #298

merged 5 commits into from
Feb 1, 2024

Conversation

mcous
Copy link
Collaborator

@mcous mcous commented Jan 29, 2024

Overview

This PR adds simple typing tests. Since Vitest's type-testing doesn't support Svelte (only vanilla TS and Vue), I implemented tests using expect-type - the library Vitest uses under the hood - and svelte-check.

Closes #199, related to #194, #195

Change log

  • Add simple typing test for render function
  • Lint and typecheck in CI for latest Svelte + latest Node.js
    • Skip linting/typechecking otherwise

@yanick
Copy link
Collaborator

yanick commented Jan 29, 2024

First victim of the test matrix. :-) The types don't agree with Svelte 3. We probably have to skip them for that version.

@mcous
Copy link
Collaborator Author

mcous commented Jan 29, 2024

I was really hoping I could come up with a clever fix for this, but no such luck. I'll disable in the matrix as suggested.

I wonder what this looks like in an actual Svelte 3 + TS project? Might have to spin one up and check it out; probably worth noting in the docs while I'm in there

@mcous
Copy link
Collaborator Author

mcous commented Jan 29, 2024

Spun up a little Svelte 3 + TS project, and I'm not 100% sure how, but the types definitely work correctly. Probably some magic from svelte-check.

Interestingly enough, while testing I discovered that the latest version of @sveltejs/vite-plugin-svelte has dropped support for Svelte 3. This will likely force our hand at some point, as much as I'd prefer not to drop support here. But for now, I can be comfortable with the fact that we only check types using Svelte 4 in CI

@yanick
Copy link
Collaborator

yanick commented Jan 30, 2024

Interestingly enough, while testing I discovered that the latest version of @sveltejs/vite-plugin-svelte has dropped support for Svelte 3. This will likely force our hand at some point, as much as I'd prefer not to drop support here.

I reckon that we'll eventually have to either drop support for Svelte 3, or create a maintenance branch for it. Which makes me think that I have to see if the semantic release mechanism even allows for different maintenance branches. 🤔

mcous added 2 commits January 31, 2024 07:51
# Conflicts:
#	.github/workflows/release.yml
#	package.json
Copy link
Collaborator Author

@mcous mcous left a comment

Choose a reason for hiding this comment

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

Nothing to see here...

package.json Outdated Show resolved Hide resolved
@yanick yanick merged commit 54ea8fa into testing-library:main Feb 1, 2024
14 checks passed
@mcous mcous deleted the test-types branch February 7, 2024 00:53
Copy link

🎉 This PR is included in version 4.2.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revisit the type changes
2 participants