- Optimization: Remove old build/tools closure/yuicompressor code - Testing: Produce mochawesome report - Testing: Cypress with multiple reporters (was expecting we'd need, but doesn't hurt to add for now) - Docs: Add testing badge - Docs: Reprioritize `docs` in commit lists (prioritize user-facing) - npm: Update `package-lock.json` (seems to have fixed so Cypress shows incremental results)
30 lines
609 B
JavaScript
30 lines
609 B
JavaScript
'use strict';
|
|
|
|
const EventEmitter = require('events');
|
|
const BadgeGenerator = require('mocha-badge-generator');
|
|
|
|
class MockRunner extends EventEmitter {}
|
|
|
|
const {stats: {passes, failures}} = require('../mochawesome.json');
|
|
|
|
const mockRunner = new MockRunner();
|
|
|
|
const options = {
|
|
reporterOptions: {
|
|
badge_output: 'badges/tests-badge.svg'
|
|
}
|
|
};
|
|
|
|
(async () => {
|
|
const p = BadgeGenerator(mockRunner, options);
|
|
mockRunner.emit('start');
|
|
for (let i = 0; i < passes; i++) {
|
|
mockRunner.emit('pass');
|
|
}
|
|
for (let i = 0; i < failures; i++) {
|
|
mockRunner.emit('fail');
|
|
}
|
|
mockRunner.emit('end');
|
|
await p;
|
|
})();
|