avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

t.skipIf syntax #2602

Closed jamestalmage closed 4 years ago

jamestalmage commented 4 years ago

I've got a handful of tests I can't run in CI. Some I can only run in Windows, etc.

Proposed sytax:

  test.skipIf(isCI).skipIf(!isWindows)('test title', t => {
  })
novemberborn commented 4 years ago

Hi @jamestalmage!

With https://github.com/avajs/ava/pull/2435 I started tinkering with a "forkable test interface". So you could do something like:

const windowsOnly = test.make({ if: () => isWindows })
windowsOnly('test title', t => {})

Ultimately I think that's more versatile than adding lots of hooks to the regular test interface. What do you think?

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)