Skip to content

Commit 24c85da

Browse files
authored
chore: prettify test.d.ts (nodejs#31)
Using Prettier.
1 parent 9585a8c commit 24c85da

File tree

1 file changed

+32
-35
lines changed

1 file changed

+32
-35
lines changed

lib/test.d.ts

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ interface TestOptions {
33
* The number of tests that can be run at the same time. If unspecified, subtests inherit this value from their parent.
44
* Default: 1.
55
*/
6-
concurrency?: boolean | number
6+
concurrency?: boolean | number;
77

88
/**
99
* 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.
1010
* Default: false.
1111
*/
12-
skip?: boolean | string
12+
skip?: boolean | string;
1313

1414
/**
1515
* 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.
1616
* Default: false.
1717
*/
18-
todo?: boolean | string
18+
todo?: boolean | string;
1919

2020
/**
2121
* A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent.
@@ -29,48 +29,48 @@ interface TestOptions {
2929
signal?: AbortSignal;
3030
}
3131

32-
type TestFn = (t: TestContext) => any | Promise<any>
32+
type TestFn = (t: TestContext) => any | Promise<any>;
3333

34-
export default test
34+
export default test;
3535

36-
export function test (name: string, options: TestOptions, fn: TestFn): void
37-
export function test (name: string, fn: TestFn): void
38-
export function test (options: TestOptions, fn: TestFn): void
39-
export function test (fn: TestFn): void
36+
export function test(name: string, options: TestOptions, fn: TestFn): void;
37+
export function test(name: string, fn: TestFn): void;
38+
export function test(options: TestOptions, fn: TestFn): void;
39+
export function test(fn: TestFn): void;
4040

4141
type SuiteFn = (t: SuiteContext) => void;
4242

43-
export function describe (name: string, options: TestOptions, fn: SuiteFn): void
44-
export function describe (name: string, fn: SuiteFn): void
45-
export function describe (options: TestOptions, fn: SuiteFn): void
46-
export function describe (fn: SuiteFn): void
43+
export function describe(name: string, options: TestOptions, fn: SuiteFn): void;
44+
export function describe(name: string, fn: SuiteFn): void;
45+
export function describe(options: TestOptions, fn: SuiteFn): void;
46+
export function describe(fn: SuiteFn): void;
4747

48-
type ItFn = (t: ItContext) => any | Promise<any>
48+
type ItFn = (t: ItContext) => any | Promise<any>;
4949

50-
export function it (name: string, options: TestOptions, fn: ItFn): void
51-
export function it (name: string, fn: ItFn): void
52-
export function it (options: TestOptions, fn: ItFn): void
53-
export function it (fn: ItFn): void
50+
export function it(name: string, options: TestOptions, fn: ItFn): void;
51+
export function it(name: string, fn: ItFn): void;
52+
export function it(options: TestOptions, fn: ItFn): void;
53+
export function it(fn: ItFn): void;
5454

5555
/**
5656
* An instance of TestContext is passed to each test function in order to interact with the test runner.
5757
* However, the TestContext constructor is not exposed as part of the API.
5858
*/
59-
declare class TestContext {
59+
declare class TestContext {
6060
/**
6161
* This function is used to create subtests under the current test. This function behaves in the same fashion as the top level test() function.
6262
*/
63-
public test (name: string, options: TestOptions, fn: TestFn): Promise<void>
64-
public test (name: string, fn: TestFn): Promise<void>
65-
public test (fn: TestFn): Promise<void>
63+
public test(name: string, options: TestOptions, fn: TestFn): Promise<void>;
64+
public test(name: string, fn: TestFn): Promise<void>;
65+
public test(fn: TestFn): Promise<void>;
6666

6767
/**
6868
* This function is used to write TAP diagnostics to the output.
6969
* Any diagnostic information is included at the end of the test's results. This function does not return a value.
7070
*
7171
* @param message Message to be displayed as a TAP diagnostic.
7272
*/
73-
public diagnostic (message: string): void
73+
public diagnostic(message: string): void;
7474

7575
/**
7676
* This function causes the test's output to indicate the test as skipped.
@@ -79,7 +79,7 @@ export function it (fn: ItFn): void
7979
*
8080
* @param message Optional skip message to be displayed in TAP output.
8181
*/
82-
public skip (message?: string): void
82+
public skip(message?: string): void;
8383

8484
/**
8585
* This function adds a TODO directive to the test's output.
@@ -88,35 +88,32 @@ export function it (fn: ItFn): void
8888
*
8989
* @param message Optional TODO message to be displayed in TAP output.
9090
*/
91-
public todo (message?: string): void
91+
public todo(message?: string): void;
9292

9393
/**
9494
* Can be used to abort test subtasks when the test has been aborted.
9595
*/
96-
public signal: AbortSignal
96+
public signal: AbortSignal;
9797
}
9898

99-
10099
/**
101-
* An instance of SuiteContext is passed to each suite function in order to interact with the test runner.
100+
* An instance of SuiteContext is passed to each suite function in order to interact with the test runner.
102101
* However, the SuiteContext constructor is not exposed as part of the API.
103102
*/
104-
declare class SuiteContext {
105-
103+
declare class SuiteContext {
106104
/**
107105
* Can be used to abort test subtasks when the test has been aborted.
108106
*/
109-
public signal: AbortSignal
107+
public signal: AbortSignal;
110108
}
111109

112110
/**
113-
* An instance of ItContext is passed to each suite function in order to interact with the test runner.
111+
* An instance of ItContext is passed to each suite function in order to interact with the test runner.
114112
* However, the ItContext constructor is not exposed as part of the API.
115113
*/
116-
declare class ItContext {
117-
114+
declare class ItContext {
118115
/**
119116
* Can be used to abort test subtasks when the test has been aborted.
120117
*/
121-
public signal: AbortSignal
118+
public signal: AbortSignal;
122119
}

0 commit comments

Comments
 (0)