diff --git a/src/tap.spec.ts b/src/tap.spec.ts new file mode 100755 index 0000000..1a207e0 --- /dev/null +++ b/src/tap.spec.ts @@ -0,0 +1,15 @@ +#!/usr/bin/env ts-node + +import { test } from './tap' + +test('test smoke testing', async t => { + t.ok('test is ok') +}) + +// test.only('test smoke testing', async t => { +// t.ok('test is ok') +// }) + +test.skip('test smoke testing', async t => { + t.ok('test is ok') +}) diff --git a/src/tap.ts b/src/tap.ts index 145e473..5379f9e 100644 --- a/src/tap.ts +++ b/src/tap.ts @@ -1,17 +1,27 @@ import tap from 'tap' +type TestOptions = NonNullable[0]> +type TestClass = InstanceType + +interface TestFunc { + (name: string, cb: (t: TestClass) => Promise | void): void + (name: string, extra: TestOptions, cb: (t: TestClass) => Promise | void): void +} + interface Test { (...args: Parameters): void - only: (...args: Parameters) => void - skip: (...args: Parameters) => void + only: TestFunc + skip: TestFunc + todo: TestFunc } const test: Test = (...args: Parameters) => { void tap.test(...args) } -test.only = tap.only -test.skip = tap.skip +test.only = tap.only as any +test.skip = tap.skip as any +test.todo = tap.todo as any export { test,