summaryrefslogtreecommitdiff
path: root/javascript/videojs/build/test-a11y.js
blob: 9debe18c62420bea63d9cf3d693df29a0cbf97c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const AccessSniff = require('access-sniff');
const path = require('path');

const testFiles = [
  path.join(__dirname, '..', 'sandbox', 'descriptions.test-a11y.html')
];

const options = {
  accessibilityLevel: 'WCAG2AA',
  reportLevels: {
    notice: false,
    warning: true,
    error: true
  },
  ignore: [
    // Ignore warning about contrast of the "vjs-no-js" fallback link
    'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.BgImage'
  ]
};

AccessSniff.default(testFiles, options).then(function(report) {
  AccessSniff.report(report);
}).catch(function() {

  // there were errors, which are already reported, exit with an error
  process.exit(1);
});