ava icon indicating copy to clipboard operation
ava copied to clipboard

`test.skip` should accept a condition

Open sindresorhus opened this issue 3 years ago • 3 comments

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');

sindresorhus avatar Feb 26 '22 08:02 sindresorhus

The "forkable test interface" I was looking to experiment with in https://github.com/avajs/ava/pull/2435 would work for this.

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

novemberborn avatar Feb 28 '22 09:02 novemberborn

Was this ever implemented in any manner?

gajus avatar Mar 27 '24 19:03 gajus

No.

novemberborn avatar Mar 31 '24 18:03 novemberborn