𧬠Multi Suite
Run multiple independent test suites β each with its own configuration β as a single, unified execution.
PluginHistory
| Version | Changes |
|---|---|
| v4.1.0 |
What is Multi Suite?β
Multi Suite lets you define multiple test suites in a single config file, each with independent settings. This allows you to:
- Run unit, integration, and e2e tests with different concurrency settings.
- Apply different reporters, plugins, or env files per suite.
- Kill ports or processes before specific suites.
- Get a single consolidated report at the end.
Suites run sequentially, one after the other. Each suite is a fully independent poku execution β if one suite fails, the next still runs.
Installβ
npm i -D @pokujs/multi-suite
Enabling the Pluginβ
Add the plugin to your Poku configuration file:
// poku.config.ts
import { defineConfig } from 'poku';
import { multiSuite } from '@pokujs/multi-suite';
export default defineConfig({
plugins: [
multiSuite([
{ include: 'test/unit', concurrency: 8 },
{ include: 'test/integration', sequential: true },
]),
],
});
Suite Optionsβ
Each suite accepts all poku config file options, applied independently. This means you can configure include, filter, exclude, concurrency, sequential, reporter, plugins, envFile, kill, quiet, and more β per suite.
Examplesβ
Different concurrency per suiteβ
import { defineConfig } from 'poku';
import { multiSuite } from '@pokujs/multi-suite';
export default defineConfig({
plugins: [
multiSuite([
{ include: 'test/unit', concurrency: 16 },
{ include: 'test/e2e', sequential: true },
]),
],
});
Load env files per suiteβ
multiSuite([
{ include: 'test/unit', envFile: '.env.test' },
{ include: 'test/integration', envFile: '.env.integration' },
]);
Scoped plugins per suiteβ
import { sharedResources } from '@pokujs/shared-resources';
multiSuite([
{ include: 'test/unit' },
{ include: 'test/integration', plugins: [sharedResources()] },
]);
Different reporter per suiteβ
multiSuite([
{ include: 'test/unit', reporter: 'dot' },
{ include: 'test/integration', reporter: 'compact' },
]);
Kill ports before a suiteβ
multiSuite([
{ include: 'test/unit' },
{
include: 'test/integration',
kill: { port: [3000, 5432] },
},
]);
How It Worksβ
- Suites run sequentially, one after the other.
- Each suite is a fully independent
pokuexecution with its own configuration. - Live file results are shown as they happen, using each suite's configured reporter.
- A single consolidated failure report and summary badge are shown at the end.
- If any suite fails, the final exit code reflects the failure β but all suites still run.
Ctrl+Cstops everything immediately.
Important Notesβ
Suite Isolationβ
Each suite runs as a separate poku() call. This means:
- Results (passed, failed, skipped) accumulate across all suites.
- A failure in one suite does not prevent subsequent suites from running.
- The final exit code is
1if any suite failed,0if all passed.
Default Directoryβ
If include is omitted from a suite, it defaults to "." (current directory). Always set include explicitly to avoid running unintended test files.
Reporter Behaviorβ
Each suite can have its own reporter. Individual file results are displayed live using each suite's reporter, but onRunResult and onExit are suppressed per suite β only the final consolidated report calls them.