Skip to main content
Version: v2.x.x

βš™οΈ Config Files

By default, Poku comes with the most common usage pre-set, but you can configure it as you want.

History
VersionChanges
v2.2.0
Support for -c short flag.
v2.1.0
Support for config files (js and cjs).
Support for config files (json and jsonc).

JavaScript​

2Stable

Pros: Supports functions and regex.
Cons: Needs to be a CommonJS file.

Create a poku.config.js (or poku.config.cjs when using "type": "module" in your package.json) in your project's root directory, for example:

const { defineConfig } = require('poku');

module.exports = defineConfig({
include: ['.'], // Doesn't support glob patterns
parallel: false,
debug: false,
filter: /\.(test.|.spec)\./,
exclude: [], // regex
failFast: false,
concurrency: 0, // No limit
quiet: false,
envFile: '.env',
kill: {
port: [3000],
range: [
[3000, 3003],
[4000, 4002],
],
pid: [612],
},
platform: 'node', // "node", "bun" and "deno"
deno: {
allow: ['run', 'env', 'read', 'hrtime', 'net'],
deny: [], // Same as allow
cjs: ['.js', '.cjs'], // specific extensions
// "cjs": true // all extensions
// "cjs": false // no polyfill
},
beforeEach: () => true, // Before each test file
afterEach: () => true, // After each test file
});

JSON and JSONC​

2Stable

Pros: Universal file for both CommonJS, ES Modules and TypeScript.
Cons: Doesn't support functions and regex.

Create a .pokurc.json (or .pokurc.jsonc) in your project's root directory, for example:

{
"$schema": "https://poku.io/schemas/configs.json",
"include": ["."], // Doesn't support glob patterns
"parallel": false,
"debug": false,
"filter": ".test.|.spec.", // regex as string
"exclude": "", // regex as string
"failFast": false,
"concurrency": 0, // No limit
"quiet": false,
"envFile": ".env",
"kill": {
"port": [3000],
"range": [
[3000, 3003],
[4000, 4002],
],
"pid": [612],
},
"platform": "node", // "node", "bun" and "deno"
"deno": {
"allow": ["run", "env", "read", "hrtime", "net"],
"deny": [], // Same as allow
"cjs": [".js", ".cjs"], // specific extensions
// "cjs": true // all extensions
// "cjs": false // no polyfill
}
}
tip
note

Shares the same limitations as CLI flags.


Default Configuration Files​

In priority order.

  • poku.config.js
  • poku.config.cjs
  • .pokurc.json
  • .pokurc.jsonc
note
  • Using a duplicate configuration via CLI will overwrite the option in the configuration file.
  • If there are multiple configuration files in the same directory, Poku will search for β€” and use β€” only one.

Custom File​

npx poku --config='my-file.json'
npx poku --config='my-file.jsonc'
npx poku --config='my-file'
  • Short flag: -c.