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

test.skip should accept a condition #2979

Open
sindresorhus opened this issue Feb 26, 2022 · 3 comments
Open

test.skip should accept a condition #2979

sindresorhus opened this issue Feb 26, 2022 · 3 comments
Labels

Comments

@sindresorhus
Copy link
Member

Sometimes you need to skip a test based on a condition, for example, only skip the test when run on Windows.

This would be kinda ugly to apply to the existing .skip modifier though:

test.skip(process.platform === 'win32')('x', t => {
	t.fail();
});

Maybe AVA could also support trailing modifiers:

test('x', t => {
	t.fail();
})
	.skip(process.platform === 'win32');
@novemberborn
Copy link
Member

The "forkable test interface" I was looking to experiment with in #2435 would work for this.

I don't think we can easily add a trailing skip.

@gajus
Copy link

gajus commented Mar 27, 2024

Was this ever implemented in any manner?

@novemberborn
Copy link
Member

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants