Skip to main content
Version: v4.x.x (Canary)

βš™οΈ Config Files

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

History
VersionChanges
vCanary
Add support for ES Modules and TypeScript config files.
Remove poku.config.cjs from auto-search.
v2.2.0
Support for -c short flag.
v2.1.0
Support for CommonJS config files (.js and .cjs).
Support for JSON and JSONC config files (.json and .jsonc).

JavaScript​

Create a poku.config.js in your project's root directory, for example:

import { defineConfig } from 'poku';

export default defineConfig({
include: ['.'], // Doesn't support glob patterns
sequential: true,
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],
},
deno: {
allow: ['run', 'env', 'read', '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​

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
"sequential": true,
"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", "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
  • .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='<file>.json'
npx poku --config='<file>.jsonc'
npx poku --config='<file>.js'
npx poku --config='<file>.cjs'
npx poku --config='<file>.mjs'
npx poku --config='<file>.ts'
npx poku --config='<file>.cts'
npx poku --config='<file>.mts'
  • Short flag: -c.