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

Moving to Vitest with help of jsdom #14

Merged
merged 1 commit into from
Jun 3, 2023

Conversation

patricknelson
Copy link
Contributor

@patricknelson patricknelson commented Jun 3, 2023

Since Snowpack is no longer active, moving to modern Vitest and fully JS based dom (jsdom) which is very fast and works very well across various environments.

Change log:

image

@patricknelson
Copy link
Contributor Author

p.s. If you merge this first, I'll update my PR #13

},
"type": "module",
Copy link
Contributor Author

@patricknelson patricknelson Jun 3, 2023

Choose a reason for hiding this comment

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

Necessary since files are named .js and not .mjs. Tested this locally using npm link and it doesn't appear to affect imports of the project itself (i.e. import Component from "svelte-tag").

@crisward
Copy link
Owner

crisward commented Jun 3, 2023

I didn't realise JSDOM supported web components. I've had a quite a few client tests fail in the past due to unsupported api's so tend to go the browser route. However in this instance JSDOM / Vitest appear to work well.

Thanks for the work on this.

@crisward crisward merged commit fb81cec into crisward:master Jun 3, 2023
1 check passed
@patricknelson patricknelson deleted the vitest branch June 3, 2023 20:56
@patricknelson
Copy link
Contributor Author

patricknelson commented Jun 3, 2023

I was worried about that too. I just gave it a shot since the API was so similar. I’m really happy the transition was relatively easy and painless.

Since my PR #13 was already merged, I’ll have to resubmit a new PR that does the same thing but addresses the failing tests since of course the whole unit test abstraction was rewritten/recreated. This of course meant the unit tests from the other PR weren’t carried over and started failing (there would have been conflicts anyway with the introduction of the <!--<TestTag>--> comments by the compiler).

More to come soon.

patricknelson referenced this pull request in patricknelson/svelte-retag Jun 5, 2023
…en not using shadow root. Take 2 required to account for new unit testing framework (Vitest) from PR #14.
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.

None yet

2 participants