Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make sure the default document is the correct instance#1295

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Janpot wants to merge1 commit intotesting-library:main
base:main
Choose a base branch
Loading
fromJanpot:fresh-doc

Conversation

@Janpot
Copy link

@JanpotJanpot commentedAug 8, 2025
edited
Loading

What

I noticed this in a setup where a jsdom instance was recreated for each test and globals were reassigned,userEvent used an outdated version of the globaldocument.

Why

It's fixable by callinguserEvent.setup({ document }) every time, but this PR makes that unnecessary.

How

Use a function to obtain default values, this makes it captureglobalThis.document at the timeuserEvent.setup() is called.

Checklist

  • [N/A] Documentation: Bug fix
  • [N/A] Tests: Feels too challenging to test under the current setup. I've added a clarifying comment. Feel free to give directions otherwise.
  • Ready to be merged : Yes, if tests pass

* of the time the API is called.
*/
constdefaultOptionsDirect:Required<Options>={
constgetDefaultOptionsDirect=():Required<Options>=>({
Copy link
Author

Choose a reason for hiding this comment

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

Could also do:

Suggested change
constgetDefaultOptionsDirect=():Required<Options>=>({
constgetDefaultOptions=(overrides:Options):Required<Options>=>({

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@Janpot

[8]ページ先頭

©2009-2025 Movatter.jp