cypress/support/terminalLog.js
/** Logs accessibility violations from cypress-axe to the console. */
Logs accessibility violations from cypress-axe to the console.
Logs accessibility violations from cypress - axe to the console .
function terminalLog(violations) {
  cy.task(
    'log',
    `${violations.length} accessibility violation${
      violations.length === 1 ? '' : 's'
    } ${violations.length === 1 ? 'was' : 'were'} detected`
  )
  const violationData = violations.map(
    ({ id, impact, description, nodes }) => ({
      id,
      impact,
      description,
      nodes: nodes.length
    })
  )
  cy.task('table', violationData)
}
function terminalLog ( violations ) { cy . task ( 'log' , ` ${ violations . length } ${ violations . length === 1 ? '' : 's' } ${ violations . length === 1 ? 'was' : 'were' } ` ) const violationData = violations . map ( ( { id , impact , description , nodes } ) => ( { id , impact , description , nodes : nodes . length } ) ) cy . task ( 'table' , violationData ) }
Logs accessibility violations from cypress-axe to the console.
Logs accessibility violations from cypress - axe to the console .
// pluck specific keys to keep the table readable