-
Notifications
You must be signed in to change notification settings - Fork 795
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
feat(runPartial): Test without frame communication #3006
Conversation
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.
So far looking good
lib/core/public/run-partial.js
Outdated
}) | ||
.then(data => { | ||
// TODO: Proper copy with .toJSON call instead of this; | ||
const results = JSON.parse(JSON.stringify(data)); |
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.
Why copy the results from data if we're just returning it?
lib/core/public/finish-run.js
Outdated
import { getReporter } from './reporter'; | ||
import { mergeResults, publishMetaData, finalizeRuleResult, DqElement } from '../utils'; | ||
|
||
export default function finishRun(data, options = {}) { |
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.
It wasn't clear what data
was in this function, had to read the tests to understand it was an array of runPartial
results.
).then(function (partialResults) { | ||
return Promise.all([ | ||
axe.finishRun(partialResults, options), | ||
axe.run(clone(context), options) |
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.
Was confused why you were running axe.run
here. Looking further into the test I see you're making sure they are the same result. Might be better if this sort of test was first defined like:
"it(should give the same results as axe.run
)"
function runPartial( | ||
context: ElementContext, | ||
options: RunOptions | ||
): Promise<unknown>; |
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.
Techdebt ticket here: #3059
var attrName = attrs[i].name; | ||
if (attrName !== 'id') { | ||
fixture.removeAttribute(attrs[i].name); | ||
if (typeof beforeEach !== 'undefined' && typeof afterEach !== 'undefined') { |
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.
I put this in so that we can use testutils outside a test run. I was using it in playground.
This adds two new methods to the
axe
object.axe.runPartial
runs axe in the current window, and collects information about its iframes.axe.finishRun
takes information from multipleaxe.runPartial
calls from different windows, builds a report from it.Closes #2936