Muthu Kumar
6 years ago
5 changed files with 62 additions and 7 deletions
@ -0,0 +1,5 @@ |
|||
const EventEmitter = require('events'); |
|||
|
|||
class GunnerEmitter extends EventEmitter {} |
|||
|
|||
module.exports = new GunnerEmitter(); |
@ -0,0 +1,42 @@ |
|||
const statusMap = { |
|||
|
|||
'ok': [ 'ok', '✅' ], |
|||
'notOk': [ 'notOk', '❌' ], |
|||
'skip': [ 'skip', '⚠️' ], |
|||
|
|||
}; |
|||
|
|||
function Default (runner, options) { |
|||
|
|||
runner.on('start', () => console.log('Started tests')); |
|||
|
|||
runner.on('test end', results => { |
|||
|
|||
results.map(x => { |
|||
|
|||
const s = statusMap[x.status]; |
|||
|
|||
console.log('>', s[0], s[1], x.description); |
|||
(options.trace |
|||
&& x.reason |
|||
&& console.log('\n---\n\n', x.reason, '\n\n---\n')); |
|||
|
|||
}); |
|||
|
|||
}); |
|||
|
|||
runner.on('end', results => { |
|||
|
|||
console.log( |
|||
results.success.length, |
|||
'tests of', |
|||
results.length, |
|||
'passed' |
|||
); |
|||
console.log('Success ratio:', results.successPercent, '%'); |
|||
|
|||
}); |
|||
|
|||
} |
|||
|
|||
module.exports = Default; |
Loading…
Reference in new issue