tstyche 5.0.0-beta.0 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/4.x/index.d.cts +251 -0
- package/build/4.x/index.d.ts +251 -0
- package/build/index.d.cts +18 -18
- package/build/index.d.ts +18 -18
- package/build/tstyche.d.ts +180 -274
- package/build/tstyche.js +715 -533
- package/package.json +12 -1
package/build/index.d.ts
CHANGED
|
@@ -102,39 +102,39 @@ interface Matchers {
|
|
|
102
102
|
*/
|
|
103
103
|
toBeApplicable: (target: unknown, context: DecoratorContext) => void;
|
|
104
104
|
/**
|
|
105
|
-
* Checks if the source type is assignable
|
|
105
|
+
* Checks if the source type is assignable from the target type.
|
|
106
106
|
*/
|
|
107
|
-
|
|
107
|
+
toBeAssignableFrom: {
|
|
108
108
|
/**
|
|
109
|
-
* Checks if the source type is assignable
|
|
109
|
+
* Checks if the source type is assignable from the target type.
|
|
110
110
|
*/
|
|
111
111
|
<Target>(): void;
|
|
112
112
|
/**
|
|
113
|
-
* Checks if the source type is assignable
|
|
113
|
+
* Checks if the source type is assignable from type of the target expression.
|
|
114
114
|
*/
|
|
115
115
|
(target: unknown): void;
|
|
116
116
|
};
|
|
117
117
|
/**
|
|
118
|
-
* Checks if the source type is assignable
|
|
118
|
+
* Checks if the source type is assignable to the target type.
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
toBeAssignableTo: {
|
|
121
121
|
/**
|
|
122
|
-
* Checks if the source type is assignable
|
|
122
|
+
* Checks if the source type is assignable to the target type.
|
|
123
123
|
*/
|
|
124
124
|
<Target>(): void;
|
|
125
125
|
/**
|
|
126
|
-
* Checks if the source type is assignable
|
|
126
|
+
* Checks if the source type is assignable to type of the target expression.
|
|
127
127
|
*/
|
|
128
128
|
(target: unknown): void;
|
|
129
129
|
};
|
|
130
130
|
/**
|
|
131
131
|
* Checks if the source type is callable with the given arguments.
|
|
132
132
|
*/
|
|
133
|
-
toBeCallableWith: (...
|
|
133
|
+
toBeCallableWith: (...args: Array<unknown>) => void;
|
|
134
134
|
/**
|
|
135
135
|
* Checks if the source type is constructable with the given arguments.
|
|
136
136
|
*/
|
|
137
|
-
toBeConstructableWith: (...
|
|
137
|
+
toBeConstructableWith: (...args: Array<unknown>) => void;
|
|
138
138
|
/**
|
|
139
139
|
* Checks if a property key exists on the source type.
|
|
140
140
|
*/
|
|
@@ -159,13 +159,13 @@ interface Expect {
|
|
|
159
159
|
/**
|
|
160
160
|
* Builds an assertion.
|
|
161
161
|
*
|
|
162
|
-
* @template Source - The type
|
|
162
|
+
* @template Source - The type which is checked.
|
|
163
163
|
*/
|
|
164
164
|
<Source>(): Modifier;
|
|
165
165
|
/**
|
|
166
166
|
* Builds an assertion.
|
|
167
167
|
*
|
|
168
|
-
* @param source - The expression
|
|
168
|
+
* @param source - The expression whose type is checked.
|
|
169
169
|
*/
|
|
170
170
|
(source: unknown): Modifier;
|
|
171
171
|
/**
|
|
@@ -175,13 +175,13 @@ interface Expect {
|
|
|
175
175
|
/**
|
|
176
176
|
* Marks an assertion as focused.
|
|
177
177
|
*
|
|
178
|
-
* @template Source - The type
|
|
178
|
+
* @template Source - The type which is checked.
|
|
179
179
|
*/
|
|
180
180
|
<Source>(): Modifier;
|
|
181
181
|
/**
|
|
182
182
|
* Marks an assertion as focused.
|
|
183
183
|
*
|
|
184
|
-
* @param source - The expression
|
|
184
|
+
* @param source - The expression whose type is checked.
|
|
185
185
|
*/
|
|
186
186
|
(source: unknown): Modifier;
|
|
187
187
|
};
|
|
@@ -192,13 +192,13 @@ interface Expect {
|
|
|
192
192
|
/**
|
|
193
193
|
* Marks an assertion as skipped.
|
|
194
194
|
*
|
|
195
|
-
* @template Source - The type
|
|
195
|
+
* @template Source - The type which is checked.
|
|
196
196
|
*/
|
|
197
197
|
<Source>(): Modifier;
|
|
198
198
|
/**
|
|
199
199
|
* Marks an assertion as skipped.
|
|
200
200
|
*
|
|
201
|
-
* @param source - The expression
|
|
201
|
+
* @param source - The expression whose type is checked.
|
|
202
202
|
*/
|
|
203
203
|
(source: unknown): Modifier;
|
|
204
204
|
};
|
|
@@ -222,11 +222,11 @@ declare const describe: Describe;
|
|
|
222
222
|
/**
|
|
223
223
|
* Defines a single test.
|
|
224
224
|
*/
|
|
225
|
-
declare const
|
|
225
|
+
declare const it: Test;
|
|
226
226
|
/**
|
|
227
227
|
* Defines a single test.
|
|
228
228
|
*/
|
|
229
|
-
declare const
|
|
229
|
+
declare const test: Test;
|
|
230
230
|
interface Actions {
|
|
231
231
|
/**
|
|
232
232
|
* Calls the given function with the provided arguments.
|
package/build/tstyche.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ declare enum CancellationReason {
|
|
|
9
9
|
|
|
10
10
|
declare class CancellationToken {
|
|
11
11
|
#private;
|
|
12
|
-
get isCancellationRequested(): boolean;
|
|
13
|
-
get reason(): CancellationReason | undefined;
|
|
14
12
|
cancel(reason: CancellationReason): void;
|
|
13
|
+
isCancellationRequested(): boolean;
|
|
14
|
+
getReason(): CancellationReason | undefined;
|
|
15
15
|
reset(): void;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -20,6 +20,120 @@ declare class Cli {
|
|
|
20
20
|
run(commandLine: Array<string>, cancellationToken?: CancellationToken): Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
declare enum DiagnosticCategory {
|
|
24
|
+
Error = "error",
|
|
25
|
+
Warning = "warning"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface SuppressedError {
|
|
29
|
+
directive: TextRange;
|
|
30
|
+
ignore: boolean;
|
|
31
|
+
argument?: TextRange;
|
|
32
|
+
diagnostics: Array<ts.Diagnostic>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare enum TestTreeNodeBrand {
|
|
36
|
+
Describe = "describe",
|
|
37
|
+
Test = "test",
|
|
38
|
+
It = "it",
|
|
39
|
+
Expect = "expect",
|
|
40
|
+
When = "when"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare enum TestTreeNodeFlags {
|
|
44
|
+
None = 0,
|
|
45
|
+
Only = 1,
|
|
46
|
+
Skip = 2,
|
|
47
|
+
Todo = 4
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class WhenNode extends TestTreeNode {
|
|
51
|
+
actionNode: ts.CallExpression;
|
|
52
|
+
actionNameNode: ts.PropertyAccessExpression;
|
|
53
|
+
abilityDiagnostics: Set<ts.Diagnostic>;
|
|
54
|
+
target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
|
|
55
|
+
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags, actionNode: ts.CallExpression, actionNameNode: ts.PropertyAccessExpression);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare class TestTreeNode {
|
|
59
|
+
brand: TestTreeNodeBrand;
|
|
60
|
+
children: Array<TestTreeNode | ExpectNode | WhenNode>;
|
|
61
|
+
diagnostics: Set<ts.Diagnostic>;
|
|
62
|
+
flags: TestTreeNodeFlags;
|
|
63
|
+
name: string;
|
|
64
|
+
node: ts.CallExpression;
|
|
65
|
+
parent: TestTree | TestTreeNode;
|
|
66
|
+
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare class ExpectNode extends TestTreeNode {
|
|
70
|
+
abilityDiagnostics: Set<ts.Diagnostic>;
|
|
71
|
+
isNot: boolean;
|
|
72
|
+
matcherNode: ts.CallExpression | ts.Decorator;
|
|
73
|
+
matcherNameNode: ts.PropertyAccessExpression;
|
|
74
|
+
modifierNode: ts.PropertyAccessExpression;
|
|
75
|
+
notNode: ts.PropertyAccessExpression | undefined;
|
|
76
|
+
source: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
|
|
77
|
+
target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode> | undefined;
|
|
78
|
+
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags, matcherNode: ts.CallExpression | ts.Decorator, matcherNameNode: ts.PropertyAccessExpression, modifierNode: ts.PropertyAccessExpression, notNode: ts.PropertyAccessExpression | undefined);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare class TestTree {
|
|
82
|
+
children: Array<TestTreeNode | ExpectNode | WhenNode>;
|
|
83
|
+
diagnostics: Set<ts.Diagnostic>;
|
|
84
|
+
hasOnly: boolean;
|
|
85
|
+
sourceFile: ts.SourceFile;
|
|
86
|
+
suppressedErrors: Array<SuppressedError> | undefined;
|
|
87
|
+
constructor(diagnostics: Set<ts.Diagnostic>, sourceFile: ts.SourceFile);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare class DiagnosticOrigin {
|
|
91
|
+
assertionNode: ExpectNode | undefined;
|
|
92
|
+
end: number;
|
|
93
|
+
sourceFile: ts.SourceFile | JsonSourceFile;
|
|
94
|
+
start: number;
|
|
95
|
+
constructor(start: number, end: number, sourceFile: ts.SourceFile | JsonSourceFile, assertionNode?: ExpectNode);
|
|
96
|
+
static fromAssertion(assertionNode: ExpectNode): DiagnosticOrigin;
|
|
97
|
+
static fromNode(node: ts.Node, assertionNode?: ExpectNode): DiagnosticOrigin;
|
|
98
|
+
static fromNodes(nodes: ts.NodeArray<ts.Node>, assertionNode?: ExpectNode): DiagnosticOrigin;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class Diagnostic {
|
|
102
|
+
category: DiagnosticCategory;
|
|
103
|
+
code: string | undefined;
|
|
104
|
+
origin: DiagnosticOrigin | undefined;
|
|
105
|
+
related: Array<Diagnostic> | undefined;
|
|
106
|
+
text: string | Array<string>;
|
|
107
|
+
constructor(text: string | Array<string>, category: DiagnosticCategory, origin?: DiagnosticOrigin);
|
|
108
|
+
add(options: {
|
|
109
|
+
code?: string | undefined;
|
|
110
|
+
related?: Array<Diagnostic> | undefined;
|
|
111
|
+
}): this;
|
|
112
|
+
static error(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
113
|
+
extendWith(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
114
|
+
static fromDiagnostics(diagnostics: Array<ts.Diagnostic>): Array<Diagnostic>;
|
|
115
|
+
static warning(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare function diagnosticBelongsToNode(diagnostic: ts.Diagnostic, node: ts.NodeArray<ts.Node> | ts.Node): boolean;
|
|
119
|
+
declare function getDiagnosticMessageText(diagnostic: ts.Diagnostic): string | Array<string>;
|
|
120
|
+
declare function getTextSpanEnd(span: ts.TextSpan): number;
|
|
121
|
+
declare function isDiagnosticWithLocation(diagnostic: ts.Diagnostic): diagnostic is ts.DiagnosticWithLocation;
|
|
122
|
+
|
|
123
|
+
type DiagnosticsHandler<T extends Diagnostic | Array<Diagnostic> = Diagnostic> = (this: void, diagnostics: T) => void;
|
|
124
|
+
|
|
125
|
+
declare class JsonSourceFile {
|
|
126
|
+
#private;
|
|
127
|
+
fileName: string;
|
|
128
|
+
text: string;
|
|
129
|
+
constructor(fileName: string, text: string);
|
|
130
|
+
getLineStarts(): Array<number>;
|
|
131
|
+
getLineAndCharacterOfPosition(position: number): {
|
|
132
|
+
line: number;
|
|
133
|
+
character: number;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
23
137
|
interface CommandLineOptions {
|
|
24
138
|
config?: string;
|
|
25
139
|
failFast?: boolean;
|
|
@@ -53,6 +167,7 @@ interface ConfigFileOptions {
|
|
|
53
167
|
testFileMatch?: Array<string>;
|
|
54
168
|
tsconfig?: string;
|
|
55
169
|
}
|
|
170
|
+
|
|
56
171
|
interface InlineConfig {
|
|
57
172
|
fixme?: boolean;
|
|
58
173
|
if?: {
|
|
@@ -139,64 +254,6 @@ declare enum OptionGroup {
|
|
|
139
254
|
ResolvedConfig = 6
|
|
140
255
|
}
|
|
141
256
|
|
|
142
|
-
declare enum DiagnosticCategory {
|
|
143
|
-
Error = "error",
|
|
144
|
-
Warning = "warning"
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
declare class SourceFile {
|
|
148
|
-
#private;
|
|
149
|
-
fileName: string;
|
|
150
|
-
text: string;
|
|
151
|
-
constructor(fileName: string, text: string);
|
|
152
|
-
getLineStarts(): Array<number>;
|
|
153
|
-
getLineAndCharacterOfPosition(position: number): {
|
|
154
|
-
line: number;
|
|
155
|
-
character: number;
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
declare class SourceService {
|
|
160
|
-
#private;
|
|
161
|
-
static get(source: SourceFile | ts.SourceFile): SourceFile | ts.SourceFile;
|
|
162
|
-
static set(source: SourceFile | ts.SourceFile): void;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
declare class DiagnosticOrigin {
|
|
166
|
-
assertionNode: ExpectNode | undefined;
|
|
167
|
-
end: number;
|
|
168
|
-
sourceFile: SourceFile | ts.SourceFile;
|
|
169
|
-
start: number;
|
|
170
|
-
constructor(start: number, end: number, sourceFile: SourceFile | ts.SourceFile, assertionNode?: ExpectNode);
|
|
171
|
-
static fromAssertion(assertionNode: ExpectNode): DiagnosticOrigin;
|
|
172
|
-
static fromNode(node: ts.Node, assertionNode?: ExpectNode): DiagnosticOrigin;
|
|
173
|
-
static fromNodes(nodes: ts.NodeArray<ts.Node>, assertionNode?: ExpectNode): DiagnosticOrigin;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
declare class Diagnostic {
|
|
177
|
-
category: DiagnosticCategory;
|
|
178
|
-
code: string | undefined;
|
|
179
|
-
origin: DiagnosticOrigin | undefined;
|
|
180
|
-
related: Array<Diagnostic> | undefined;
|
|
181
|
-
text: string | Array<string>;
|
|
182
|
-
constructor(text: string | Array<string>, category: DiagnosticCategory, origin?: DiagnosticOrigin);
|
|
183
|
-
add(options: {
|
|
184
|
-
code?: string | undefined;
|
|
185
|
-
related?: Array<Diagnostic> | undefined;
|
|
186
|
-
}): this;
|
|
187
|
-
static error(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
188
|
-
extendWith(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
189
|
-
static fromDiagnostics(diagnostics: Array<ts.Diagnostic>): Array<Diagnostic>;
|
|
190
|
-
static warning(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
declare function diagnosticBelongsToNode(diagnostic: ts.Diagnostic, node: ts.NodeArray<ts.Node> | ts.Node): boolean;
|
|
194
|
-
declare function getDiagnosticMessageText(diagnostic: ts.Diagnostic): string | Array<string>;
|
|
195
|
-
declare function getTextSpanEnd(span: ts.TextSpan): number;
|
|
196
|
-
declare function isDiagnosticWithLocation(diagnostic: ts.Diagnostic): diagnostic is ts.DiagnosticWithLocation;
|
|
197
|
-
|
|
198
|
-
type DiagnosticsHandler<T extends Diagnostic | Array<Diagnostic> = Diagnostic> = (this: void, diagnostics: T) => void;
|
|
199
|
-
|
|
200
257
|
interface BaseOptionDefinition {
|
|
201
258
|
brand: OptionBrand;
|
|
202
259
|
description: string;
|
|
@@ -222,88 +279,6 @@ declare class Options {
|
|
|
222
279
|
static validate(optionName: string, optionValue: string, onDiagnostics: DiagnosticsHandler, origin?: DiagnosticOrigin): Promise<void>;
|
|
223
280
|
}
|
|
224
281
|
|
|
225
|
-
declare class ProjectService {
|
|
226
|
-
#private;
|
|
227
|
-
constructor(compiler: typeof ts, resolvedConfig: ResolvedConfig);
|
|
228
|
-
closeFile(filePath: string): void;
|
|
229
|
-
getDefaultProject(filePath: string): ts.server.Project | undefined;
|
|
230
|
-
getLanguageService(filePath: string): ts.LanguageService | undefined;
|
|
231
|
-
openFile(filePath: string, sourceText?: string | undefined, projectRootPath?: string | undefined): void;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
declare enum TestTreeNodeBrand {
|
|
235
|
-
Describe = "describe",
|
|
236
|
-
Test = "test",
|
|
237
|
-
Expect = "expect",
|
|
238
|
-
When = "when"
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
declare enum TestTreeNodeFlags {
|
|
242
|
-
None = 0,
|
|
243
|
-
Only = 1,
|
|
244
|
-
Skip = 2,
|
|
245
|
-
Todo = 4
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
declare class WhenNode extends TestTreeNode {
|
|
249
|
-
actionNode: ts.CallExpression;
|
|
250
|
-
actionNameNode: ts.PropertyAccessExpression;
|
|
251
|
-
abilityDiagnostics: Set<ts.Diagnostic>;
|
|
252
|
-
target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
|
|
253
|
-
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags, actionNode: ts.CallExpression, actionNameNode: ts.PropertyAccessExpression);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
declare class TestTreeNode {
|
|
257
|
-
brand: TestTreeNodeBrand;
|
|
258
|
-
children: Array<TestTreeNode | ExpectNode | WhenNode>;
|
|
259
|
-
diagnostics: Set<ts.Diagnostic>;
|
|
260
|
-
flags: TestTreeNodeFlags;
|
|
261
|
-
name: string;
|
|
262
|
-
node: ts.CallExpression;
|
|
263
|
-
parent: TestTree | TestTreeNode;
|
|
264
|
-
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
declare class ExpectNode extends TestTreeNode {
|
|
268
|
-
abilityDiagnostics: Set<ts.Diagnostic>;
|
|
269
|
-
isNot: boolean;
|
|
270
|
-
matcherNode: ts.CallExpression | ts.Decorator;
|
|
271
|
-
matcherNameNode: ts.PropertyAccessExpression;
|
|
272
|
-
modifierNode: ts.PropertyAccessExpression;
|
|
273
|
-
notNode: ts.PropertyAccessExpression | undefined;
|
|
274
|
-
source: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
|
|
275
|
-
target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode> | undefined;
|
|
276
|
-
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags, matcherNode: ts.CallExpression | ts.Decorator, matcherNameNode: ts.PropertyAccessExpression, modifierNode: ts.PropertyAccessExpression, notNode: ts.PropertyAccessExpression | undefined);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
interface SuppressedError {
|
|
280
|
-
directive: TextRange;
|
|
281
|
-
ignore: boolean;
|
|
282
|
-
argument?: TextRange;
|
|
283
|
-
diagnostics: Array<ts.Diagnostic>;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
declare class TestTree {
|
|
287
|
-
children: Array<TestTreeNode | ExpectNode | WhenNode>;
|
|
288
|
-
diagnostics: Set<ts.Diagnostic>;
|
|
289
|
-
hasOnly: boolean;
|
|
290
|
-
sourceFile: ts.SourceFile;
|
|
291
|
-
suppressedErrors: Array<SuppressedError> | undefined;
|
|
292
|
-
constructor(diagnostics: Set<ts.Diagnostic>, sourceFile: ts.SourceFile);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
declare class CollectService {
|
|
296
|
-
#private;
|
|
297
|
-
constructor(compiler: typeof ts, projectService: ProjectService, resolvedConfig: ResolvedConfig);
|
|
298
|
-
createTestTree(sourceFile: ts.SourceFile, semanticDiagnostics?: Array<ts.Diagnostic>): TestTree;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
declare function nodeBelongsToArgumentList(compiler: typeof ts, node: ts.Node): boolean;
|
|
302
|
-
|
|
303
|
-
declare function argumentIsProvided<T>(argumentNameText: string, node: T, enclosingNode: ts.Node, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): node is NonNullable<T>;
|
|
304
|
-
|
|
305
|
-
declare function argumentOrTypeArgumentIsProvided<T>(argumentNameText: string, typeArgumentNameText: string, node: T, enclosingNode: ts.Node, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): node is NonNullable<T>;
|
|
306
|
-
|
|
307
282
|
interface EnvironmentOptions {
|
|
308
283
|
isCi: boolean;
|
|
309
284
|
noColor: boolean;
|
|
@@ -344,42 +319,53 @@ declare class WatchReporter extends BaseReporter {
|
|
|
344
319
|
on([event, payload]: ReporterEvent): void;
|
|
345
320
|
}
|
|
346
321
|
|
|
347
|
-
declare class ResultTiming {
|
|
348
|
-
end: number;
|
|
349
|
-
start: number;
|
|
350
|
-
get duration(): number;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
322
|
declare enum ResultStatus {
|
|
354
323
|
Runs = "runs",
|
|
355
324
|
Passed = "passed",
|
|
325
|
+
Matched = "matched",
|
|
356
326
|
Failed = "failed",
|
|
357
|
-
Skipped = "skipped",
|
|
358
327
|
Fixme = "fixme",
|
|
328
|
+
Skipped = "skipped",
|
|
329
|
+
Ignored = "ignored",
|
|
359
330
|
Todo = "todo"
|
|
360
331
|
}
|
|
361
332
|
|
|
333
|
+
type TargetResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
334
|
+
type TargetCounts = {
|
|
335
|
+
[K in Exclude<TargetResultStatus, ResultStatus.Runs>]: number;
|
|
336
|
+
};
|
|
337
|
+
type FileResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
338
|
+
type FileCounts = {
|
|
339
|
+
[K in Exclude<FileResultStatus, ResultStatus.Runs>]: number;
|
|
340
|
+
};
|
|
341
|
+
type TestResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed | ResultStatus.Skipped | ResultStatus.Fixme | ResultStatus.Todo;
|
|
342
|
+
type TestCounts = {
|
|
343
|
+
[K in Exclude<TestResultStatus, ResultStatus.Runs>]: number;
|
|
344
|
+
};
|
|
345
|
+
type AssertionResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed | ResultStatus.Skipped | ResultStatus.Fixme | ResultStatus.Todo;
|
|
346
|
+
type AssertionCounts = {
|
|
347
|
+
[K in Exclude<AssertionResultStatus, ResultStatus.Runs>]: number;
|
|
348
|
+
};
|
|
349
|
+
type SuppressedResultStatus = ResultStatus.Matched | ResultStatus.Failed | ResultStatus.Ignored;
|
|
350
|
+
type SuppressedCounts = {
|
|
351
|
+
[K in SuppressedResultStatus]: number;
|
|
352
|
+
};
|
|
353
|
+
type ResultCounts = TargetCounts | FileCounts | TestCounts | AssertionCounts | SuppressedCounts;
|
|
354
|
+
interface ResultTiming {
|
|
355
|
+
start: number;
|
|
356
|
+
end: number;
|
|
357
|
+
}
|
|
358
|
+
|
|
362
359
|
declare class ExpectResult {
|
|
363
360
|
expect: ExpectNode;
|
|
364
|
-
diagnostics: Array<Diagnostic>;
|
|
365
361
|
parent: TestResult | undefined;
|
|
366
|
-
status:
|
|
362
|
+
status: AssertionResultStatus;
|
|
367
363
|
timing: ResultTiming;
|
|
368
364
|
constructor(expect: ExpectNode, parent?: TestResult);
|
|
369
365
|
}
|
|
370
366
|
|
|
371
|
-
declare class ResultCount {
|
|
372
|
-
failed: number;
|
|
373
|
-
passed: number;
|
|
374
|
-
skipped: number;
|
|
375
|
-
fixme: number;
|
|
376
|
-
todo: number;
|
|
377
|
-
get total(): number;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
367
|
declare class TestResult {
|
|
381
|
-
|
|
382
|
-
expectCount: ResultCount;
|
|
368
|
+
assertionCounts: AssertionCounts;
|
|
383
369
|
parent: DescribeResult | undefined;
|
|
384
370
|
results: Array<ExpectResult>;
|
|
385
371
|
status: ResultStatus;
|
|
@@ -403,27 +389,24 @@ declare class FileLocation {
|
|
|
403
389
|
constructor(file: string | URL, position?: number);
|
|
404
390
|
}
|
|
405
391
|
|
|
406
|
-
type FileResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
407
392
|
declare class FileResult {
|
|
408
|
-
|
|
409
|
-
expectCount: ResultCount;
|
|
393
|
+
assertionCounts: AssertionCounts;
|
|
410
394
|
file: FileLocation;
|
|
411
395
|
results: Array<DescribeResult | TestResult | ExpectResult>;
|
|
396
|
+
suppressedCounts: SuppressedCounts;
|
|
412
397
|
status: FileResultStatus;
|
|
413
|
-
|
|
398
|
+
testCounts: TestCounts;
|
|
414
399
|
timing: ResultTiming;
|
|
415
400
|
constructor(file: FileLocation);
|
|
416
401
|
}
|
|
417
402
|
|
|
418
403
|
declare class ProjectResult {
|
|
419
404
|
compilerVersion: string;
|
|
420
|
-
diagnostics: Array<Diagnostic>;
|
|
421
405
|
projectConfigFilePath: string | undefined;
|
|
422
406
|
results: Array<FileResult>;
|
|
423
407
|
constructor(compilerVersion: string, projectConfigFilePath: string | undefined);
|
|
424
408
|
}
|
|
425
409
|
|
|
426
|
-
type TargetResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
427
410
|
declare class TargetResult {
|
|
428
411
|
files: Array<FileLocation>;
|
|
429
412
|
results: Map<string | undefined, ProjectResult>;
|
|
@@ -434,16 +417,22 @@ declare class TargetResult {
|
|
|
434
417
|
}
|
|
435
418
|
|
|
436
419
|
declare class Result {
|
|
437
|
-
|
|
438
|
-
|
|
420
|
+
assertionCounts: AssertionCounts;
|
|
421
|
+
fileCounts: FileCounts;
|
|
439
422
|
files: Array<FileLocation>;
|
|
440
423
|
results: Array<TargetResult>;
|
|
441
|
-
|
|
442
|
-
|
|
424
|
+
suppressedCounts: SuppressedCounts;
|
|
425
|
+
targetCounts: TargetCounts;
|
|
426
|
+
testCounts: TestCounts;
|
|
443
427
|
timing: ResultTiming;
|
|
444
428
|
constructor(files: Array<FileLocation>);
|
|
445
429
|
}
|
|
446
430
|
|
|
431
|
+
declare class SuppressedResult {
|
|
432
|
+
suppressed: SuppressedError;
|
|
433
|
+
constructor(suppressed: SuppressedError);
|
|
434
|
+
}
|
|
435
|
+
|
|
447
436
|
interface EventHandler {
|
|
448
437
|
on: (event: Event) => void;
|
|
449
438
|
}
|
|
@@ -519,6 +508,13 @@ type Event = ["config:error", {
|
|
|
519
508
|
result: ExpectResult;
|
|
520
509
|
}] | ["expect:fixme", {
|
|
521
510
|
result: ExpectResult;
|
|
511
|
+
}] | ["suppressed:error", {
|
|
512
|
+
diagnostics: Array<Diagnostic>;
|
|
513
|
+
result: SuppressedResult;
|
|
514
|
+
}] | ["suppressed:match", {
|
|
515
|
+
result: SuppressedResult;
|
|
516
|
+
}] | ["suppressed:ignore", {
|
|
517
|
+
result: SuppressedResult;
|
|
522
518
|
}] | ["watch:error", {
|
|
523
519
|
diagnostics: Array<Diagnostic>;
|
|
524
520
|
}];
|
|
@@ -536,65 +532,6 @@ declare class EventEmitter {
|
|
|
536
532
|
removeReporters(): void;
|
|
537
533
|
}
|
|
538
534
|
|
|
539
|
-
declare class Reject {
|
|
540
|
-
#private;
|
|
541
|
-
constructor(compiler: typeof ts, typeChecker: ts.TypeChecker, resolvedConfig: ResolvedConfig);
|
|
542
|
-
argumentType(target: Array<[name: string, node: ts.Expression | ts.TypeNode | undefined]>, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): boolean;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
interface MatchResult {
|
|
546
|
-
explain: () => Array<Diagnostic>;
|
|
547
|
-
isMatch: boolean;
|
|
548
|
-
}
|
|
549
|
-
interface TypeChecker extends ts.TypeChecker {
|
|
550
|
-
isApplicableIndexType: (source: ts.Type, target: ts.Type) => boolean;
|
|
551
|
-
isTypeIdenticalTo: (source: ts.Type, target: ts.Type) => boolean;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
declare class ExpectService {
|
|
555
|
-
#private;
|
|
556
|
-
private toAcceptProps;
|
|
557
|
-
private toBe;
|
|
558
|
-
private toBeApplicable;
|
|
559
|
-
private toBeAssignableTo;
|
|
560
|
-
private toBeAssignableWith;
|
|
561
|
-
private toBeCallableWith;
|
|
562
|
-
private toBeConstructableWith;
|
|
563
|
-
private toHaveProperty;
|
|
564
|
-
private toRaiseError;
|
|
565
|
-
constructor(compiler: typeof ts, typeChecker: TypeChecker, reject: Reject);
|
|
566
|
-
match(assertionNode: ExpectNode, onDiagnostics: DiagnosticsHandler<Diagnostic | Array<Diagnostic>>): MatchResult | undefined;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
declare class Glob {
|
|
570
|
-
#private;
|
|
571
|
-
static toRegex(patterns: Array<string>, target: "directories" | "files"): RegExp;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
declare class CancellationHandler implements EventHandler {
|
|
575
|
-
#private;
|
|
576
|
-
constructor(cancellationToken: CancellationToken, cancellationReason: CancellationReason);
|
|
577
|
-
on([, payload]: Event): void;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
declare class ExitCodeHandler implements EventHandler {
|
|
581
|
-
#private;
|
|
582
|
-
on([event, payload]: Event): void;
|
|
583
|
-
resetCode(): void;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
declare class ResultHandler implements EventHandler {
|
|
587
|
-
#private;
|
|
588
|
-
on([event, payload]: Event): void;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
type InputHandler = (chunk: string) => void;
|
|
592
|
-
declare class InputService {
|
|
593
|
-
#private;
|
|
594
|
-
constructor(onInput: InputHandler);
|
|
595
|
-
close(): void;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
535
|
declare enum Color {
|
|
599
536
|
Reset = "0",
|
|
600
537
|
Red = "31",
|
|
@@ -678,15 +615,17 @@ declare class OutputService {
|
|
|
678
615
|
static writeWarning(element: ScribblerJsx.Element | Array<ScribblerJsx.Element>): void;
|
|
679
616
|
}
|
|
680
617
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
618
|
+
interface SummaryTextOptions {
|
|
619
|
+
targetCounts: ResultCounts;
|
|
620
|
+
fileCounts: ResultCounts;
|
|
621
|
+
testCounts: ResultCounts;
|
|
622
|
+
assertionCounts: ResultCounts;
|
|
623
|
+
suppressedCounts: SuppressedCounts;
|
|
624
|
+
timing: ResultTiming;
|
|
625
|
+
}
|
|
626
|
+
declare function summaryText({ targetCounts, fileCounts, testCounts, assertionCounts, suppressedCounts, timing, }: SummaryTextOptions): ScribblerJsx.Element;
|
|
688
627
|
|
|
689
|
-
declare function testNameText(status:
|
|
628
|
+
declare function testNameText(status: Exclude<TestResultStatus, ResultStatus.Runs>, name: string, indent?: number): ScribblerJsx.Element;
|
|
690
629
|
|
|
691
630
|
declare function usesCompilerText(compilerVersion: string, projectConfigFilePath: string | undefined, options?: {
|
|
692
631
|
prependEmptyLine: boolean;
|
|
@@ -785,11 +724,6 @@ declare class Store {
|
|
|
785
724
|
static validateTag(tag: string): Promise<boolean | undefined>;
|
|
786
725
|
}
|
|
787
726
|
|
|
788
|
-
declare class SuppressedService {
|
|
789
|
-
#private;
|
|
790
|
-
match(testTree: TestTree, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): void;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
727
|
declare class Version {
|
|
794
728
|
#private;
|
|
795
729
|
static isGreaterThan(source: string, target: string): boolean;
|
|
@@ -797,33 +731,5 @@ declare class Version {
|
|
|
797
731
|
static isSatisfiedWith(source: string, target: string): boolean;
|
|
798
732
|
}
|
|
799
733
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
recursive?: boolean;
|
|
803
|
-
}
|
|
804
|
-
declare class Watcher {
|
|
805
|
-
#private;
|
|
806
|
-
constructor(targetPath: string, onChanged: WatchHandler, onRemoved?: WatchHandler, options?: WatcherOptions);
|
|
807
|
-
close(): void;
|
|
808
|
-
watch(): void;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
type FileWatchHandler = () => void;
|
|
812
|
-
declare class FileWatcher extends Watcher {
|
|
813
|
-
constructor(targetPath: string, onChanged: FileWatchHandler);
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
declare class WatchService {
|
|
817
|
-
#private;
|
|
818
|
-
constructor(resolvedConfig: ResolvedConfig, files: Array<FileLocation>);
|
|
819
|
-
watch(cancellationToken: CancellationToken): AsyncIterable<Array<FileLocation>>;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
declare class WhenService {
|
|
823
|
-
#private;
|
|
824
|
-
constructor(reject: Reject, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>);
|
|
825
|
-
action(when: WhenNode): void;
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
export { BaseReporter, CancellationHandler, CancellationReason, CancellationToken, Cli, CollectService, Color, Config, ConfigDiagnosticText, DescribeResult, Diagnostic, DiagnosticCategory, DiagnosticOrigin, Directive, EventEmitter, ExitCodeHandler, ExpectNode, ExpectResult, ExpectService, FileLocation, FileResult, FileWatcher, Glob, InputService, Line, ListReporter, OptionBrand, OptionGroup, Options, OutputService, Path, PluginService, ProjectResult, ProjectService, Reject, Result, ResultCount, ResultHandler, ResultStatus, ResultTiming, Runner, Scribbler, ScribblerJsx, Select, SelectDiagnosticText, SetupReporter, SourceFile, SourceService, Store, SummaryReporter, SuppressedService, TargetResult, TestResult, TestTree, TestTreeNode, TestTreeNodeBrand, TestTreeNodeFlags, Text, Version, WatchReporter, WatchService, Watcher, WhenNode, WhenService, addsPackageText, argumentIsProvided, argumentOrTypeArgumentIsProvided, defaultOptions, describeNameText, diagnosticBelongsToNode, diagnosticText, environmentOptions, fileStatusText, fileViewText, formattedText, getDiagnosticMessageText, getTextSpanEnd, helpText, isDiagnosticWithLocation, nodeBelongsToArgumentList, summaryText, testNameText, usesCompilerText, waitingForFileChangesText, watchUsageText };
|
|
829
|
-
export type { CodeFrameOptions, CommandLineOptions, ConfigFileOptions, DiagnosticsHandler, DirectiveRange, EnvironmentOptions, Event, EventHandler, FileResultStatus, FileWatchHandler, InlineConfig, InputHandler, ItemDefinition, MatchResult, OptionDefinition, Plugin, Reporter, ReporterEvent, ResolvedConfig, ScribblerOptions, SelectHookContext, SuppressedError, TargetResultStatus, TextRange, TypeChecker, WatchHandler, WatcherOptions };
|
|
734
|
+
export { BaseReporter, CancellationReason, CancellationToken, Cli, Color, Config, ConfigDiagnosticText, DescribeResult, Diagnostic, DiagnosticCategory, DiagnosticOrigin, Directive, EventEmitter, ExpectResult, FileLocation, FileResult, Line, ListReporter, OptionBrand, OptionGroup, Options, OutputService, Path, PluginService, ProjectResult, Result, ResultStatus, Runner, Scribbler, ScribblerJsx, Select, SelectDiagnosticText, SetupReporter, Store, SummaryReporter, SuppressedResult, TargetResult, TestResult, Text, Version, WatchReporter, addsPackageText, defaultOptions, describeNameText, diagnosticBelongsToNode, diagnosticText, environmentOptions, fileStatusText, fileViewText, formattedText, getDiagnosticMessageText, getTextSpanEnd, helpText, isDiagnosticWithLocation, summaryText, testNameText, usesCompilerText, waitingForFileChangesText, watchUsageText };
|
|
735
|
+
export type { AssertionCounts, AssertionResultStatus, CodeFrameOptions, CommandLineOptions, ConfigFileOptions, DiagnosticsHandler, DirectiveRange, EnvironmentOptions, Event, EventHandler, FileCounts, FileResultStatus, InlineConfig, ItemDefinition, OptionDefinition, Plugin, Reporter, ReporterEvent, ResolvedConfig, ResultCounts, ResultTiming, ScribblerOptions, SelectHookContext, SuppressedCounts, SuppressedResultStatus, TargetCounts, TargetResultStatus, TestCounts, TestResultStatus, TextRange };
|