Spec reporter
Reporters in Japa are responsible for displaying/saving the progress of tests. The spec reporter displays a detailed report of all the tests in the terminal.
Installation and setup
Install the package from the npm registry as follows.
npm i -D @japa/spec-reporter@1.3.3
And register it as a reporter within the bin/test.js
file.
import { specReporter } from '@japa/spec-reporter'
import { configure, processCliArgs } from '@japa/runner'
configure({
...processCliArgs(process.argv.slice(2)),
...{
files: ['tests/**/*.spec.js']
reporters: [specReporter()]
}
})
const { specReporter } = require('@japa/spec-reporter')
const { configure, processCliArgs } = require('@japa/runner')
configure({
...processCliArgs(process.argv.slice(2)),
...{
files: ['tests/**/*.spec.js']
reporters: [specReporter()]
}
})