mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
16 lines
426 B
JavaScript
16 lines
426 B
JavaScript
|
|
/**
|
||
|
|
* Builds a simple message of the violation results of axe-core by listing
|
||
|
|
* each violation and the associated element selector in a new line.
|
||
|
|
* @param {!axe.Violation} violation
|
||
|
|
*/
|
||
|
|
exports.buildMessage = violation => {
|
||
|
|
|
||
|
|
let selectors = violation.nodes.map(node => {
|
||
|
|
return node.target.join(' ');
|
||
|
|
});
|
||
|
|
|
||
|
|
return selectors.reduce((content, selector) => {
|
||
|
|
return content + '- ' + selector + '\n';
|
||
|
|
}, '');
|
||
|
|
|
||
|
|
};
|