Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"standard-version": "^9.5.0",
"start-server-and-test": "^3.0.2",
"typedarray": "^0.0.7",
"typescript": "^5.2.2",
"typescript": "^6.0.3",
"uglify-js": "^3.17.4",
"wcag-act-rules": "github:w3c/wcag-act-rules#5adb55d19eb2cd7fb23213b2d1acedf9004dc063",
"weakmap-polyfill": "^2.0.4"
Expand Down
14 changes: 8 additions & 6 deletions typings/axe-core/axe-core-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ axe.run(context, {}, (error: Error, results: axe.AxeResults) => {
console.log(results.incomplete.length);
const errors = results.incomplete.map(result => result.error);
console.log(
errors.map(
({ message, stack, ruleId, method }) =>
`${message} ${ruleId} ${method}\n\n${stack}`
errors.map(error =>
error
? `${error.message} ${error.ruleId} ${error.method}\n\n${error.stack}`
: ''
)
);
console.log(results.inapplicable.length);
Expand Down Expand Up @@ -57,7 +58,7 @@ export async function runAsync() {
await axe.run([[['main']]]);
await axe.run([[['#app', 'main']]]); // Selecting in the outer frame

await axe.run(document.querySelector('main'));
await axe.run(document.querySelector('main')!);
await axe.run(document.querySelectorAll('main'));
// axe.run with frameContext context
await axe.run({ fromShadowDom: ['#app', '#main', '#inner'] });
Expand Down Expand Up @@ -409,7 +410,8 @@ let fooReporter = (
resolve: (out: 'foo') => void,
reject: (err: Error) => void
) => {
reject && resolve('foo');
reject(new Error('foo'));
resolve('foo');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wait, what is the purpose of this test? If we reject, then resolve would be a no-op.

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.

It's a type test file, so it doesn't actually test that the code compiles and runs it just makes sure typescript doesn't give errors with our API. So the point of that code is just to make sure typescript knows reject and resolve are functions passed into the function.

};

axe.addReporter<'foo'>('foo', fooReporter, true);
Expand Down Expand Up @@ -465,7 +467,7 @@ axe.utils.nodeSerializer.update({
return axe.utils.DqElement.mergeSpecs(childSpec, parentSpec);
}
});
const spec2: axe.SerialDqElement = axe.utils.nodeSerializer.toSpec(element);
const spec2: axe.SerialDqElement = axe.utils.nodeSerializer.toSpec(element!);
const spec3: axe.SerialDqElement = axe.utils.nodeSerializer.dqElmToSpec(
dqElement,
options
Expand Down
Loading