|
| 1 | +/* eslint-disable */ |
| 2 | + |
| 3 | +declare type tape$TestOpts = { |
| 4 | + skip: boolean, |
| 5 | + timeout?: number, |
| 6 | +} | { |
| 7 | + skip?: boolean, |
| 8 | + timeout: number, |
| 9 | +}; |
| 10 | + |
| 11 | +declare type tape$TestCb = (t: tape$Context) => mixed; |
| 12 | +declare type tape$TestFn = (a: string | tape$TestOpts | tape$TestCb, b?: tape$TestOpts | tape$TestCb, c?: tape$TestCb) => void; |
| 13 | + |
| 14 | +declare interface tape$Context { |
| 15 | + fail(msg?: string): void, |
| 16 | + pass(msg?: string): void, |
| 17 | + |
| 18 | + error(err: mixed, msg?: string): void, |
| 19 | + ifError(err: mixed, msg?: string): void, |
| 20 | + ifErr(err: mixed, msg?: string): void, |
| 21 | + iferror(err: mixed, msg?: string): void, |
| 22 | + |
| 23 | + ok(value: mixed, msg?: string): void, |
| 24 | + true(value: mixed, msg?: string): void, |
| 25 | + assert(value: mixed, msg?: string): void, |
| 26 | + |
| 27 | + notOk(value: mixed, msg?: string): void, |
| 28 | + false(value: mixed, msg?: string): void, |
| 29 | + notok(value: mixed, msg?: string): void, |
| 30 | + |
| 31 | + // equal + aliases |
| 32 | + equal(actual: mixed, expected: mixed, msg?: string): void, |
| 33 | + equals(actual: mixed, expected: mixed, msg?: string): void, |
| 34 | + isEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 35 | + is(actual: mixed, expected: mixed, msg?: string): void, |
| 36 | + strictEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 37 | + strictEquals(actual: mixed, expected: mixed, msg?: string): void, |
| 38 | + |
| 39 | + // notEqual + aliases |
| 40 | + notEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 41 | + notEquals(actual: mixed, expected: mixed, msg?: string): void, |
| 42 | + notStrictEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 43 | + notStrictEquals(actual: mixed, expected: mixed, msg?: string): void, |
| 44 | + isNotEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 45 | + isNot(actual: mixed, expected: mixed, msg?: string): void, |
| 46 | + not(actual: mixed, expected: mixed, msg?: string): void, |
| 47 | + doesNotEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 48 | + isInequal(actual: mixed, expected: mixed, msg?: string): void, |
| 49 | + |
| 50 | + // deepEqual + aliases |
| 51 | + deepEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 52 | + deepEquals(actual: mixed, expected: mixed, msg?: string): void, |
| 53 | + isEquivalent(actual: mixed, expected: mixed, msg?: string): void, |
| 54 | + same(actual: mixed, expected: mixed, msg?: string): void, |
| 55 | + |
| 56 | + // notDeepEqual |
| 57 | + notDeepEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 58 | + notEquivalent(actual: mixed, expected: mixed, msg?: string): void, |
| 59 | + notDeeply(actual: mixed, expected: mixed, msg?: string): void, |
| 60 | + notSame(actual: mixed, expected: mixed, msg?: string): void, |
| 61 | + isNotDeepEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 62 | + isNotDeeply(actual: mixed, expected: mixed, msg?: string): void, |
| 63 | + isNotEquivalent(actual: mixed, expected: mixed, msg?: string): void, |
| 64 | + isInequivalent(actual: mixed, expected: mixed, msg?: string): void, |
| 65 | + |
| 66 | + // deepLooseEqual |
| 67 | + deepLooseEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 68 | + looseEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 69 | + looseEquals(actual: mixed, expected: mixed, msg?: string): void, |
| 70 | + |
| 71 | + // notDeepLooseEqual |
| 72 | + notDeepLooseEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 73 | + notLooseEqual(actual: mixed, expected: mixed, msg?: string): void, |
| 74 | + notLooseEquals(actual: mixed, expected: mixed, msg?: string): void, |
| 75 | + |
| 76 | + throws(fn: Function, expected?: RegExp | Function, msg?: string): void, |
| 77 | + doesNotThrow(fn: Function, expected?: RegExp | Function, msg?: string): void, |
| 78 | + |
| 79 | + timeoutAfter(ms: number): void, |
| 80 | + |
| 81 | + skip(msg?: string): void, |
| 82 | + plan(n: number): void, |
| 83 | + onFinish(fn: Function): void, |
| 84 | + end(): void, |
| 85 | + comment(msg: string): void, |
| 86 | + test: tape$TestFn, |
| 87 | +} |
| 88 | + |
| 89 | +declare module 'tape-cup' { |
| 90 | + declare type TestHarness = Tape; |
| 91 | + declare type StreamOpts = { |
| 92 | + objectMode?: boolean, |
| 93 | + }; |
| 94 | + |
| 95 | + declare type Tape = { |
| 96 | + (a: string | tape$TestOpts | tape$TestCb, b?: tape$TestCb | tape$TestOpts, c?: tape$TestCb, ...rest: Array<void>): void, |
| 97 | + test: tape$TestFn, |
| 98 | + skip: (name: string, cb?: tape$TestCb) => void, |
| 99 | + createHarness: () => TestHarness, |
| 100 | + createStream: (opts?: StreamOpts) => stream$Readable, |
| 101 | + only: (a: string | tape$TestOpts | tape$TestCb, b?: tape$TestCb | tape$TestOpts, c?: tape$TestCb, ...rest: Array<void>) => void, |
| 102 | + }; |
| 103 | + |
| 104 | + declare module.exports: Tape; |
| 105 | +} |
0 commit comments