<commit_before>var axsPath = require.resolve('../vendor/axs_testing')

exports.addCommand = function (client, requireName) {
  client.addCommand('performAccessibilityAudit', function () {
    return this.execute(function (axsPath, requireName) {
      var axs = window[requireName](axsPath)
      var results = axs.Audit.run().filter(function (result) {
        return result.result === 'FAIL'
      })

      if (results.length > 0) {
        var message = 'Accessibilty audit failed\n\n'
        message += results.map(function (result) {
          return axs.Audit.accessibilityErrorMessage(result)
        }).join('\n\n')

        return {
          message: message,
          failed: true,
          results: results.map(function (result) {
            return {
              code: result.rule.code,
              elements: result.elements.map(function (element) {
                return axs.utils.getQuerySelectorText(element)
              }),
              message: result.rule.heading,<commit_msg>results -> failures<commit_after>var axsPath = require.resolve('../vendor/axs_testing')

exports.addCommand = function (client, requireName) {
  client.addCommand('performAccessibilityAudit', function () {
    return this.execute(function (axsPath, requireName) {
      var axs = window[requireName](axsPath)
      var failures = axs.Audit.run().filter(function (result) {
        return result.result === 'FAIL'
      })

      if (failures.length > 0) {
        var message = 'Accessibilty audit failed\n\n'
        message += failures.map(function (result) {
          return axs.Audit.accessibilityErrorMessage(result)
        }).join('\n\n')

        return {
          message: message,
          failed: true,
          results: failures.map(function (result) {
            return {
              code: result.rule.code,
              elements: result.elements.map(function (element) {
                return axs.utils.getQuerySelectorText(element)
              }),
              message: result.rule.heading,
{'fraction_non_alphanumeric': 0.11956521739130435, 'fraction_numerical': 0.0009881422924901185, 'mean_word_length': 2.330592105263158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7179974', 'n_tokens_mistral': 556, 'n_tokens_neox': 549, 'n_words': 110}