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

fix: use happy-dom instead of jsdom in tests #286

Closed
wants to merge 1 commit into from
Closed

Conversation

yanick
Copy link
Collaborator

@yanick yanick commented Jan 23, 2024

Takes care of the lack of reactivity seen in #119

Takes care of the lack of reactivity seen in #119
Copy link
Collaborator

@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.

Completely anecdotally, our main UI test suite at Viam (closed source, unfortunately) passes on jsdom and fails in lots of tests on happy-dom. I haven't dug into it yet, but it makes me a bit hesitant to switch happy-dom in the main test suite here, as promising as it is.

Something I'd like to explore is a larger matrix of test suite runs, ideally something like

  • Runners: Jest, Vitest + jsdom, Vitest + happy-dom
  • Svelte versions: v3, v4, v5-next

I'll file a separate ticket for that idea after I've had some time to poke at it

test('should modify the text after clicking the button', async () => {
render(Component)
const button = screen.getByRole('button')
userEvent.click(button)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't there be an await on userEvent.click, since it's an async method?

@yanick
Copy link
Collaborator Author

yanick commented Jan 31, 2024

#297 does it better.

@yanick yanick closed this Jan 31, 2024
@mcous mcous deleted the gh119-nonbound branch June 2, 2024 17:35
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