-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
94 lines (93 loc) · 3.01 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
declare class GasTap {
/**
*
* GasT - Google Apps Script Testing-framework
*
* GasT is a TAP-compliant testing framework for Google Apps Script.
* It provides a simple way to verify that the GAS programs you write
* behave as expected.
*
* Github - https://github.com/zixia/gast
* Test Anything Protocol - http://testanything.org/
*
* Issues: https://github.com/zixia/gast/issues
* Author: Zhuohuan LI <[email protected]>
* Date: 2015-11-05
*
* Example:
```javascript
if ((typeof GasTap)==='undefined') { // GasT Initialization. (only if not initialized yet.)
eval(UrlFetchApp.fetch('https://raw.githubusercontent.com/zixia/gast/master/src/gas-tap-lib.js').getContentText())
} // Class GasTap is ready for use now!
var test = new GasTap()
```
*/
protected VERSION: string;
protected totalSucc: number;
protected totalFail: number;
protected totalSkip: number;
constructor(options?: IOptions);
private loggerFunc(msg);
/***************************************************************
*
* Instance methods export
*
****************************************************************/
readonly totalFailed: number;
readonly totalSucceed: number;
readonly totalSkipped: number;
test(description: string, run: runFuncType): void;
print(...args: any[]): void;
/**
* Prints a total line to log output. For an example "3 tests, 0 failures"
*
* @returns tapResults
*/
finish(): tapResults;
}
declare class test {
static counter: number;
succCounter: number;
failCounter: number;
skipCounter: number;
description: string;
EXCEPTION_SKIP: string;
EXCEPTION_PASS: string;
EXCEPTION_FAIL: string;
print: printFuncType;
/***************************************************************
*
* T 's functions
*
****************************************************************/
constructor(desc: string | null, tap: GasTap);
private tapOutput(ok, msg);
ok(value: any, msg: string): void;
notOk(value: any, msg: string): void;
equal(v1: any, v2: any, msg: string): void;
notEqual(v1: any, v2: any, msg: string): void;
deepEqual(v1: any, v2: any, msg: string): void;
notDeepEqual(v1: any, v2: any, msg: string): void;
nan(v1: any, msg: string): void;
notNan(v1: any, msg: string): void;
throws(fn: anyFunc, msg: string): void;
notThrow(fn: anyFunc, msg: string): void;
skip(msg: string): void;
pass(msg: string): void;
fail(msg: string): void;
reset(): void;
}
declare type loggerFuncType = (msg: string) => void;
declare type runFuncType = (t: test) => void;
declare type anyFunc = (...args: any[]) => any;
declare type tapOutputFuncType = (ok: boolean, msg: string) => void;
declare type printFuncType = (...args: any[]) => void;
interface IOptions {
loggerFunc: loggerFuncType;
}
interface tapResults {
nTotal: number;
nSucceeded: number;
nFailed: number;
nSkipped: number;
}