Skip to main content

⏭️ skip

Skipping a test file

You can skip test files when necessary:

import { skip } from 'poku';

skip();

You can also pass an optional message to skip method:

import { skip } from 'poku';

skip('Skipping for some reason');
important

This will skip the entire file and it's recommended to be used at the top of the test file.

note

Skipped tests are considered successful tests and don't affect the file test count.


Examples

Imagine that a specific test doesn't work on a specific OS:

import { test, skip } from 'poku';
import { platform } from 'node:process';

const isWindows = platform === 'win32';

if (isWindows) skip('Skipping due to incompatibility with Windows');

// Runs tests normally on other operating systems
test(() => {
// ...
});

describe, it and test modifier

To assist in the debugging process, you can modify your tests by temporarily skipping specific tests:

import { describe, it } from 'poku';

describe(() => {
it('Running this', () => {
// I'll be executed
});

it.skip('Skipping for some reason', () => {
// I won't be executed
});
});

Supports:

  • describe.skip
  • it.skip
  • test.skip
note

Skipped tests are considered successful tests and don't affect the file test count.