jest-audio-reporter
Version:
Plays audio on jest events
30 lines (26 loc) • 540 B
text/typescript
import { store } from './store'
export function createLog() {
return {
enabled: false,
writer: console,
debug(...args) {
if (store.devel) return
if (this.enabled) {
// istanbul ignore next
this.writer.info(...args)
}
}
}
}
export function logOptions({ log }, raw, options) {
if (!raw.configs) {
log.debug('no config detected')
}
else {
log.debug(`configs location:
${raw.configs.map(c => ` ${c}`).join('\n')}
options:
${JSON.stringify(options, undefined, 2)}
`)
}
}