function doneTest() { puts(colo.bold.green(`✓ success count: ${ state.successCount }`)); if (state.failureCount) { puts(colo.bold.red(`✗ failure count: ${ state.failureCount }`)); } if (state.skippedCount) { puts(colo.bold.yellow(`☐ skipped count: ${ state.skippedCount }`)); } }
module.exports.diff = function reason(diff, depth) { if (depth == null) { depth = 0; } if (Array.isArray(diff) && diff.length === 2) { console.log(''); const agreed = diff[0]; const actual = diff[1]; const exp = explain(agreed, actual); exp && console.log(colo.bold(exp)); console.log(`${colo.bold.cyan('agreed: ')} ${show(agreed)}`); console.log(`${colo.bold.red('actual: ')} ${show(actual)}`); console.log(''); return; } if (depth > 0) { process.stdout.write(colo.bold('.')); } Object.keys(diff).forEach((key) => { process.stdout.write(colo.bold(`${key}`)); reason(diff[key], depth + 1); }); };