function assert(violations) {
    function result(word, count) {
      const postfix = (count === 1) ? '' : 's';

      return `${count} ${word}${postfix}`;
    }

    const toTotal = (accumulator, violation) => accumulator + violation.nodes.length;
    const total = violations.reduce(toTotal, 0);
    const { length } = violations;
    const message = `${result('violation', total)} of ${result('rule', length)}`;

    expect(violations, message).to.be.empty;
  }
/**
   * There is only a single assertion for every test:
   * that there are no violations.
   * If the assertion fails, the `violations` object itself
   * can be inspected in the console.
   * @param {Object} violations
   */
There is only a single assertion for every test:
that there are no violations.
If the assertion fails, the `violations` object itself
can be inspected in the console.
@param {Object} violations
There is only a single assertion for every test : that there are no violations . If the assertion fails the ` violations ` object itself can be inspected in the console . @param { Object } violations
function assert(violations) {
    function result(word, count) {
      const postfix = (count === 1) ? '' : 's';
      return `${count} ${word}${postfix}`;
    }
    const toTotal = (accumulator, violation) => accumulator + violation.nodes.length;
    const total = violations.reduce(toTotal, 0);
    const { length } = violations;
    const message = `${result('violation', total)} of ${result('rule', length)}`;
    expect(violations, message).to.be.empty;
  }
function assert ( violations ) { function result ( word , count ) { const postfix = ( count === 1 ) ? '' : 's' ; return ` ${ count } ${ word } ${ postfix } ` ; } const toTotal = ( accumulator , violation ) => accumulator + violation . nodes . length ; const total = violations . reduce ( toTotal , 0 ) ; const { length } = violations ; const message = ` ${ result ( 'violation' , total ) } ${ result ( 'rule' , length ) } ` ; expect ( violations , message ) . to . be . empty ; }
There is only a single assertion for every test:
 that there are no violations.
There is only a single assertion for every test : that there are no violations .