Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(skip): allow to skip tests #523

Merged
merged 2 commits into from
Jul 8, 2024
Merged

feat(skip): allow to skip tests #523

merged 2 commits into from
Jul 8, 2024

Conversation

wellwelwel
Copy link
Owner

You can now skip tests 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.


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(() => {
  // ...
});

Note

Skipped tests are considered successful tests.

@wellwelwel wellwelwel changed the title Skip feat(skip): allow to skip tests Jul 8, 2024
@wellwelwel wellwelwel marked this pull request as ready for review July 8, 2024 07:03
@wellwelwel wellwelwel merged commit fccfb0d into main Jul 8, 2024
28 checks passed
@wellwelwel wellwelwel deleted the skip branch July 8, 2024 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant