βοΈ Config Files
By default, Poku comes with the most common usage pre-set, but you can configure it as you want.
History
Version | Changes |
---|---|
v2.2.0 | -c short flag. |
v2.1.0 | js and cjs ).json and jsonc ). |
JavaScriptβ
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β
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
- The
$schema
property allows an JSON intellisense to assist you customize Poku. - All options are optional.
- See details of all the options.
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
.