reporter
Specify the reporter for test execution.
History
| Version | Changes |
|---|---|
| v3.0.3-canary.a1456563 | verbose reporter. Its behavior is now the default in the poku reporter. |
Reporters
poku (default)
- Logs all
describe,it,testandasserttitles and messages, including their modifiers. - Logs errors both in real time and at the running end.
dot (inspired by Mocha)
- Logs a dot for each success file test and
Ffor each failed file. - Lists all logs for each failed file at the running end.
compact (partially inspired by modern Tap)
- Lists only file paths with
PASSorFAILand, in case of failures, lists all logs for each failed file at the running end.
focus
- Logs only errors (in real time). If there is no error, it just logs a small footnote resume.
classic
- The standard report style from version 2 to preserve our history 🐷
Usage
CLI
- poku
- dot
- compact
- focus
- classic
npx poku --reporter=poku # default
npx poku --reporter=dot
npx poku --reporter=compact
npx poku --reporter=focus
npx poku --reporter=classic
- Short flag:
-r.
Config File
- poku
- dot
- compact
- focus
- classic
{
// "$schema": "https://poku.io/schemas/configs.json",
"reporter": "poku" // default
}
const { defineConfig } = require('poku');
module.exports = defineConfig({
reporter: 'poku', // default
});
{
// "$schema": "https://poku.io/schemas/configs.json",
"reporter": "dot"
}
const { defineConfig } = require('poku');
module.exports = defineConfig({
reporter: 'dot',
});
{
// "$schema": "https://poku.io/schemas/configs.json",
"reporter": "compact"
}
const { defineConfig } = require('poku');
module.exports = defineConfig({
reporter: 'compact',
});
{
// "$schema": "https://poku.io/schemas/configs.json",
"reporter": "focus"
}
const { defineConfig } = require('poku');
module.exports = defineConfig({
reporter: 'focus',
});
{
// "$schema": "https://poku.io/schemas/configs.json",
"reporter": "classic"
}
const { defineConfig } = require('poku');
module.exports = defineConfig({
reporter: 'classic',
});
API
- poku
- dot
- compact
- focus
- classic
await poku('./test', {
reporter: 'poku', // default
});
await poku('./test', {
reporter: 'dot',
});
await poku('./test', {
reporter: 'compact',
});
await poku('./test', {
reporter: 'focus',
});
await poku('./test', {
reporter: 'classic',
});
dica
- To create a custom reporter, see Custom Reporters.
- To debug, see
debugoption. - To quiet the output, see
quietoption. - Both the
--debugand--quietoptions work with all reporters.