- Refactoring: Move build-html to build directory
- 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)
This commit is contained in:
29
build/testing-badge.js
Normal file
29
build/testing-badge.js
Normal file
@@ -0,0 +1,29 @@
|
||||
'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;
|
||||
})();
|
||||
Reference in New Issue
Block a user