testSkipPattern
Skip tests whose title matches the given pattern.
History
| Version | Changes |
|---|---|
| v4.2.0 | testSkipPattern option. |
Unlike exclude which excludes file paths, testSkipPattern skips individual test titles (it and test blocks).
CLIβ
# Skip tests containing "legacy" in the title
npx poku --testSkipPattern='legacy' ./test
Config Fileβ
- json
- js
{
"$schema": "https://poku.io/schemas/configs.json",
"testSkipPattern": "legacy"
}
import { defineConfig } from 'poku';
export default defineConfig({
testSkipPattern: /legacy/,
});
APIβ
await poku('./test', {
testSkipPattern: /legacy/,
});
Exampleβ
Given a test file:
import { test, assert } from 'poku';
test('Auth: login with valid credentials', () => {
assert(true);
});
test('Auth: reject invalid token', () => {
assert(true);
});
test('Users: list all users', () => {
assert(true);
});
Running with --testSkipPattern='Auth:' will skip the two Auth tests and only execute Users: list all users:
npx poku --testSkipPattern='Auth:' ./test
tip
To run only specific tests by title instead, see testNamePattern.
To exclude by file path, see exclude.
info
This option is inspired by Node.js' --test-skip-pattern.