Skip to content

tests: ensure after and reporter methods can run in isolated context#3136

Merged
straker merged 3 commits intodevelopfrom
test-isolated
Aug 26, 2021
Merged

tests: ensure after and reporter methods can run in isolated context#3136
straker merged 3 commits intodevelopfrom
test-isolated

Conversation

@straker
Copy link
Copy Markdown
Contributor

@straker straker commented Aug 25, 2021

This was a difficult one to set up. Hopefully this does what we want and ensures our after and reporter methods can run when window and document are not there.

@straker straker requested a review from a team as a code owner August 25, 2021 23:56
Copy link
Copy Markdown
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

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

Couple minor points


function setEmptyReporter() {
win.axeConfigure({
reporter: function(results, options, callback) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like the raw reporter. Why not use that?

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.

I didn't want to use a reporter in case the reporter throws. A simple custom reporter ensures it wont throw by accessing things it shouldn't

Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
@straker straker merged commit 7215dc4 into develop Aug 26, 2021
@straker straker deleted the test-isolated branch August 26, 2021 15:28
straker added a commit that referenced this pull request Oct 18, 2021
…3136)

* tests: ensure after and reporter methods can run in isolated context

* Update test/integration/full/isolated-env/isolated-env.js

Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>

* cleanup

Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
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