forked from testdeck/testdeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.d.ts
64 lines (54 loc) · 3.06 KB
/
globals.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/// <reference path="./index.d.ts" />
/**
* This TypeScript declaration file describes the API provided by mocha-typescript when it is used as custom-ui.
* To import the definitions, use somewhere in your test files the tripple slash reference:
* /// <reference path="node_modules/mocha-typescript/globals.d.ts" />
*/
declare namespace Mocha {
export interface IContextDefinition {
/**
* This is either a single trait overload `(trait: MochaTypeScript.SuiteTrait): ClassDecorator`
* or a class decorator overload `(target: Function): void`.
* Can't figure out proper typing.
*/
(args: any): any;
(): ClassDecorator;
(name: string): ClassDecorator;
(name: string, ... traits: MochaTypeScript.SuiteTrait[]): ClassDecorator;
(trait: MochaTypeScript.SuiteTrait, ... traits:MochaTypeScript.SuiteTrait[]): ClassDecorator;
only(arg: any): any;
only(): ClassDecorator;
only(name: string): ClassDecorator;
only(name: string, ... traits: MochaTypeScript.SuiteTrait[]): ClassDecorator;
only(... traits:MochaTypeScript.SuiteTrait[]): ClassDecorator;
skip(arg: any): any;
skip(): ClassDecorator;
skip(name: string): ClassDecorator;
skip(name: string, ... traits: MochaTypeScript.SuiteTrait[]): ClassDecorator;
skip(... traits:MochaTypeScript.SuiteTrait[]): ClassDecorator;
}
export interface ITestDefinition {
(target: Object, propertyKey: string | symbol): void;
(name: string): PropertyDecorator;
(name: string, ... traits: MochaTypeScript.TestTrait[]): PropertyDecorator;
(... traits: MochaTypeScript.TestTrait[]): PropertyDecorator;
only(target: Object, propertyKey: string | symbol): void;
only(name: string): PropertyDecorator;
only(name: string, ... traits: MochaTypeScript.TestTrait[]): PropertyDecorator;
only(... traits: MochaTypeScript.TestTrait[]): PropertyDecorator;
skip(target: Object, propertyKey: string | symbol): void;
skip(name: string): PropertyDecorator;
skip(name: string, ... traits: MochaTypeScript.TestTrait[]): PropertyDecorator;
skip(... traits: MochaTypeScript.TestTrait[]): PropertyDecorator;
}
}
declare var suite: Mocha.IContextDefinition;
declare var test: Mocha.ITestDefinition;
declare var describe: Mocha.IContextDefinition;
declare var it: Mocha.ITestDefinition;
declare var skipOnError: MochaTypeScript.SuiteTrait;
declare function slow(time: number): PropertyDecorator & ClassDecorator & MochaTypeScript.SuiteTrait & MochaTypeScript.TestTrait;
declare function timeout(time: number): PropertyDecorator & ClassDecorator & MochaTypeScript.SuiteTrait & MochaTypeScript.TestTrait;
declare function pending<TFunction extends Function>(target: Object | TFunction, propertyKey?: string | symbol): void;
declare function only<TFunction extends Function>(target: Object, propertyKey?: string | symbol): void;
declare function skip<TFunction extends Function>(target: Object | TFunction, propertyKey?: string | symbol): void;