Skip to content

Commit

Permalink
Revert "Remove axe config obj in favor of callback"
Browse files Browse the repository at this point in the history
This reverts commit fe8c039.
  • Loading branch information
jul-sh committed Dec 2, 2019
1 parent fe8c039 commit c008086
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/AxeObserver.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import AuditQueue from './AuditQueue.mjs'
export default class AxeObserver {
constructor(
violationsCallback,
axeCoreConfigurationCallback = function(axeInstance) {
axeInstance.configure({
{
axeCoreConfiguration = {
reporter: 'v2',
checks: [
{
Expand All @@ -18,8 +18,9 @@ export default class AxeObserver {
}
}
]
})
}
},
axeCoreInstanceCallback
} = {}
) {
if (typeof violationsCallback !== 'function') {
throw new Error(
Expand All @@ -43,10 +44,13 @@ export default class AxeObserver {
// AuditQueue sequentially runs audits when the browser is idle.
this._auditQueue = new AuditQueue()

// Configure axe, register plugins etc
// Allow for registering plugins etc
if (typeof axeInstanceCallback === 'function') {
axeCoreConfigurationCallback(axeCore)
axeCoreInstanceCallback(axeCore)
}

// Configure axe
axeCore.configure(axeCoreConfiguration)
}
observe(targetNode) {
if (!targetNode) {
Expand Down

0 comments on commit c008086

Please sign in to comment.