@@ -7,7 +7,7 @@
const rimraf = require('rimraf').sync
const onExit = require('signal-exit')
const {writeFileSync, readFileSync} = require('fs')
-const util = require('util')
+const {stringify} = require('tap-yaml')
class Watch extends Minipass {
constructor (options) {
@@ -88,7 +88,7 @@
const tests = this.testsFromChange(file)
this.queue.push(...tests)
- this.log(ev, file)
+ this.log(ev + ' ' + file)
if (this.proc)
return this.log('test in progress, queuing for next run')
@@ -140,8 +140,10 @@
this.emit('afterProcess', {code, signal})
}
- log (...args) {
- this.write(util.format(...args) + '\n')
+ log (msg, arg) {
+ if (arg && typeof arg !== 'string')
+ msg += '\n' + stringify(arg)
+ this.write(msg + '\n')
}
testsFromChange (file) {