Skip to content

fix(jsdom): allow axe.setup() without a global window#4116

Merged
WilcoFiers merged 2 commits intodevelopfrom
dom-setup
Aug 2, 2023
Merged

fix(jsdom): allow axe.setup() without a global window#4116
WilcoFiers merged 2 commits intodevelopfrom
dom-setup

Conversation

@WilcoFiers
Copy link
Copy Markdown
Contributor

axe.setup() should set up temporary globals when globalThis.window and/or globalThis.document aren't set up. This PR fixes that.

Closes #3962

@WilcoFiers WilcoFiers requested a review from a team as a code owner August 1, 2023 17:04
}

function handleRunRules(rawResults, cleanup) {
function handleRunRules(rawResults, teardown) {
Copy link
Copy Markdown
Contributor Author

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.

axe.utils.performanceTimer.end();
}
axe._running = false;
resetGlobals();
Copy link
Copy Markdown
Contributor Author

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.

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.

axe.setup should set globals

2 participants