-
Notifications
You must be signed in to change notification settings - Fork 771
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(jsdom): allow axe.setup() without a global window #4116
Conversation
@@ -36,10 +36,10 @@ export default function run(...args) { | |||
axe.utils.performanceTimer.start(); | |||
} | |||
|
|||
function handleRunRules(rawResults, cleanup) { | |||
function handleRunRules(rawResults, teardown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is actually just the teardown method, it's confusing to have it named something else here.
@@ -66,7 +66,6 @@ export default function run(...args) { | |||
axe.utils.performanceTimer.end(); | |||
} | |||
axe._running = false; | |||
resetGlobals(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already called in teardown
, which is invoked earlier. Calling resetGlobals
here does nothing, and wouldn't actually have worked because axe's cache has been cleaned up by this point. Same is true for the other resetGlobals()
call in this file.
axe.setup()
should set up temporary globals whenglobalThis.window
and/orglobalThis.document
aren't set up. This PR fixes that.Closes #3962