/
githubmirror
/
react-beautiful-dnd
Обзор
Документация
Войти
/
githubmirror
/
react-beautiful-dnd
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
a11y-audit-parse.js
31 строка
1 KB
Alex Reardon
12.0 (#1487)
29 окт 2019, 01:40
Не верифицирован
29 окт 2019, 01:40
24a8e60
Код
Авторство
О чём код?
/* eslint-disable flowtype/require-valid-file-annotation */ /* eslint-disable import/no-unresolved */ /* eslint-disable global-require */ /* eslint-disable no-console */ try { // I disabled flow for this file because of this line. // Sometimes the file exists, sometimes it doesn't. // It depends on if you have run the accessibility test or not. // Given this conditional I thought it best to simply disable flow for the file const a11yReport = require('./test-reports/lighthouse/a11y.report.json'); const a11yScore = a11yReport.categories.accessibility.score; const a11yScoreFormatted = `${a11yScore ? a11yScore * 100 : 0}%`; console.log('*************************'); console.log('Lighthouse accessibility score: ', a11yScoreFormatted); console.log('*************************'); if (a11yScore === 1) { // success! process.exit(0); } else { // fail build console.log( '\nNOTE: Lighthouse accessibility audit score must be 100% to pass this build step.\n\n', ); process.exit(1); } } catch (e) { console.error(e); process.exit(1); }