Pular para o conteúdo principal
Versão: v4.x.x

testSkipPattern

Skip tests whose title matches the given pattern.

History
VersionChanges
v4.2.0
Introduces 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

{
"$schema": "https://poku.io/schemas/configs.json",
"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

dica

To run only specific tests by title instead, see testNamePattern. To exclude by file path, see exclude.

informação

This option is inspired by Node.js' --test-skip-pattern.