@sa11y/format
Advanced tools
Comparing version 0.2.0-alpha to 0.2.1-beta.0
@@ -48,11 +48,11 @@ "use strict"; | ||
constructor(violations) { | ||
super(`${violations.length} accessibility issues found`); | ||
super(`${violations.length} ${A11yError.errMsgHeader}`); | ||
this.violations = violations; | ||
this.name = A11yError.name; | ||
this.message = `${violations.length} ${A11yError.errMsgHeader}\n ${this.format()}`; | ||
} | ||
get message() { | ||
// TODO (debug): Why is this not used (in code cov) even when A11yError.message is called ? | ||
// Looks like the super().message is invoked | ||
/* istanbul ignore next */ | ||
return this.format(); | ||
static checkAndThrow(violations) { | ||
if (violations.length > 0) { | ||
throw new A11yError(violations); | ||
} | ||
} | ||
@@ -68,3 +68,3 @@ get length() { | ||
options = Object.assign(Object.assign({}, DefaultOptions), options); | ||
if (options.formatter) { | ||
if (options.formatter !== undefined) { | ||
return options.formatter(this.violations); | ||
@@ -91,2 +91,3 @@ } | ||
exports.A11yError = A11yError; | ||
A11yError.errMsgHeader = 'accessibility issues found'; | ||
//# sourceMappingURL=format.js.map |
{ | ||
"name": "@sa11y/format", | ||
"version": "0.2.0-alpha", | ||
"version": "0.2.1-beta.0", | ||
"description": "Accessibility results re-formatter", | ||
@@ -25,10 +25,9 @@ "license": "BSD-3-Clause", | ||
], | ||
"dependencies": { | ||
"axe-core": "3.5.5" | ||
}, | ||
"devDependencies": { | ||
"@sa11y/test-utils": "0.1.1-alpha", | ||
"axe-core": "^3.5.4" | ||
"@sa11y/test-utils": "0.2.0-beta.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"gitHead": "40b4b80d3a164e01777b45af82aa22e9fa03bb3a" | ||
"gitHead": "1ac74866530acda3854cb60cc3047fb70ad0d999" | ||
} |
@@ -1,2 +0,2 @@ | ||
# `format` | ||
# `@sa11y/format` | ||
@@ -3,0 +3,0 @@ Format accessibility results from axe |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6138
1
89
1
+ Addedaxe-core@3.5.5
+ Addedaxe-core@3.5.5(transitive)