Skip to content

Commit

Permalink
chore: update types (nodejs#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow authored Jul 20, 2022
1 parent c132f7e commit b1689a7
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions lib/test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,30 @@ type TestFn = (t: TestContext) => any | Promise<any>

export default test

/**
* @returns Whether `string` is a URL.
*/
declare function test (name: string, options: TestOptions, fn: TestFn): void
declare function test (name: string, fn: TestFn): void
declare function test (fn: TestFn): void
export function test (name: string, options: TestOptions, fn: TestFn): void
export function test (name: string, fn: TestFn): void
export function test (options: TestOptions, fn: TestFn): void
export function test (fn: TestFn): void

type SuiteFn = () => void;

export function describe (name: string, options: TestOptions, fn: SuiteFn): void
export function describe (name: string, fn: SuiteFn): void
export function describe (options: TestOptions, fn: SuiteFn): void
export function describe (fn: SuiteFn): void

type ItFn = () => any | Promise<any>

export function it (name: string, options: TestOptions, fn: ItFn): void
export function it (name: string, fn: ItFn): void
export function it (options: TestOptions, fn: ItFn): void
export function it (fn: ItFn): void

/**
* An instance of TestContext is passed to each test function in order to interact with the test runner.
* However, the TestContext constructor is not exposed as part of the API.
*/
export class TestContext {
declare class TestContext {
/**
* This function is used to create subtests under the current test. This function behaves in the same fashion as the top level test() function.
*/
Expand Down

0 comments on commit b1689a7

Please sign in to comment.