( nameOrOptions: ITestOptions | string, optionsOrFn: Omit<ITestOptions, "name"> | (() => void), fn?: () => void )
| 13 | fn: (ctx?: ITestOptions) => void |
| 14 | ): void; |
| 15 | export function test( |
| 16 | nameOrOptions: ITestOptions | string, |
| 17 | optionsOrFn: Omit<ITestOptions, "name"> | (() => void), |
| 18 | fn?: () => void |
| 19 | ): void { |
| 20 | const newTest = Test.create(nameOrOptions, optionsOrFn, fn); |
| 21 | if (Suite.globalStack.length > 0) { |
| 22 | Suite.globalStack.slice(-1)[0].addTest(newTest); |
| 23 | } else { |
| 24 | throw new Error("Cannot create a top level test, must be created in a suite."); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | export class Test { |
| 29 | public static readonly DEFAULT_TIMEOUT_MILLIS = 30000; |
no test coverage detected