diff --git a/lib/test.d.ts b/lib/test.d.ts index 5a21c5b..29e794b 100644 --- a/lib/test.d.ts +++ b/lib/test.d.ts @@ -3,19 +3,19 @@ interface TestOptions { * The number of tests that can be run at the same time. If unspecified, subtests inherit this value from their parent. * Default: 1. */ - concurrency?: boolean | number + concurrency?: boolean | number; /** * If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test. * Default: false. */ - skip?: boolean | string + skip?: boolean | string; /** * If truthy, the test marked as TODO. If a string is provided, that string is displayed in the test results as the reason why the test is TODO. * Default: false. */ - todo?: boolean | string + todo?: boolean | string; /** * A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent. @@ -29,40 +29,40 @@ interface TestOptions { signal?: AbortSignal; } -type TestFn = (t: TestContext) => any | Promise +type TestFn = (t: TestContext) => any | Promise; -export default test +export default test; -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 +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 = (t: SuiteContext) => 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 +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 = (t: ItContext) => any | Promise +type ItFn = (t: ItContext) => any | Promise; -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 +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. */ - declare 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. */ - public test (name: string, options: TestOptions, fn: TestFn): Promise - public test (name: string, fn: TestFn): Promise - public test (fn: TestFn): Promise + public test(name: string, options: TestOptions, fn: TestFn): Promise; + public test(name: string, fn: TestFn): Promise; + public test(fn: TestFn): Promise; /** * This function is used to write TAP diagnostics to the output. @@ -70,7 +70,7 @@ export function it (fn: ItFn): void * * @param message Message to be displayed as a TAP diagnostic. */ - public diagnostic (message: string): void + public diagnostic(message: string): void; /** * This function causes the test's output to indicate the test as skipped. @@ -79,7 +79,7 @@ export function it (fn: ItFn): void * * @param message Optional skip message to be displayed in TAP output. */ - public skip (message?: string): void + public skip(message?: string): void; /** * This function adds a TODO directive to the test's output. @@ -88,35 +88,32 @@ export function it (fn: ItFn): void * * @param message Optional TODO message to be displayed in TAP output. */ - public todo (message?: string): void + public todo(message?: string): void; /** * Can be used to abort test subtasks when the test has been aborted. */ - public signal: AbortSignal + public signal: AbortSignal; } - /** - * An instance of SuiteContext is passed to each suite function in order to interact with the test runner. + * An instance of SuiteContext is passed to each suite function in order to interact with the test runner. * However, the SuiteContext constructor is not exposed as part of the API. */ - declare class SuiteContext { - +declare class SuiteContext { /** * Can be used to abort test subtasks when the test has been aborted. */ - public signal: AbortSignal + public signal: AbortSignal; } /** - * An instance of ItContext is passed to each suite function in order to interact with the test runner. + * An instance of ItContext is passed to each suite function in order to interact with the test runner. * However, the ItContext constructor is not exposed as part of the API. */ - declare class ItContext { - +declare class ItContext { /** * Can be used to abort test subtasks when the test has been aborted. */ - public signal: AbortSignal + public signal: AbortSignal; }