tstyche 5.0.0-beta.0 → 5.0.0-beta.1
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 +16 -16
- package/build/index.d.ts +16 -16
- package/build/tstyche.d.ts +177 -272
- package/build/tstyche.js +650 -499
- package/package.json +12 -1
package/build/tstyche.d.ts
CHANGED
|
@@ -20,6 +20,119 @@ 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
|
+
Expect = "expect",
|
|
39
|
+
When = "when"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare enum TestTreeNodeFlags {
|
|
43
|
+
None = 0,
|
|
44
|
+
Only = 1,
|
|
45
|
+
Skip = 2,
|
|
46
|
+
Todo = 4
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare class WhenNode extends TestTreeNode {
|
|
50
|
+
actionNode: ts.CallExpression;
|
|
51
|
+
actionNameNode: ts.PropertyAccessExpression;
|
|
52
|
+
abilityDiagnostics: Set<ts.Diagnostic>;
|
|
53
|
+
target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
|
|
54
|
+
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags, actionNode: ts.CallExpression, actionNameNode: ts.PropertyAccessExpression);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare class TestTreeNode {
|
|
58
|
+
brand: TestTreeNodeBrand;
|
|
59
|
+
children: Array<TestTreeNode | ExpectNode | WhenNode>;
|
|
60
|
+
diagnostics: Set<ts.Diagnostic>;
|
|
61
|
+
flags: TestTreeNodeFlags;
|
|
62
|
+
name: string;
|
|
63
|
+
node: ts.CallExpression;
|
|
64
|
+
parent: TestTree | TestTreeNode;
|
|
65
|
+
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare class ExpectNode extends TestTreeNode {
|
|
69
|
+
abilityDiagnostics: Set<ts.Diagnostic>;
|
|
70
|
+
isNot: boolean;
|
|
71
|
+
matcherNode: ts.CallExpression | ts.Decorator;
|
|
72
|
+
matcherNameNode: ts.PropertyAccessExpression;
|
|
73
|
+
modifierNode: ts.PropertyAccessExpression;
|
|
74
|
+
notNode: ts.PropertyAccessExpression | undefined;
|
|
75
|
+
source: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
|
|
76
|
+
target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode> | undefined;
|
|
77
|
+
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);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare class TestTree {
|
|
81
|
+
children: Array<TestTreeNode | ExpectNode | WhenNode>;
|
|
82
|
+
diagnostics: Set<ts.Diagnostic>;
|
|
83
|
+
hasOnly: boolean;
|
|
84
|
+
sourceFile: ts.SourceFile;
|
|
85
|
+
suppressedErrors: Array<SuppressedError> | undefined;
|
|
86
|
+
constructor(diagnostics: Set<ts.Diagnostic>, sourceFile: ts.SourceFile);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare class DiagnosticOrigin {
|
|
90
|
+
assertionNode: ExpectNode | undefined;
|
|
91
|
+
end: number;
|
|
92
|
+
sourceFile: ts.SourceFile | JsonSourceFile;
|
|
93
|
+
start: number;
|
|
94
|
+
constructor(start: number, end: number, sourceFile: ts.SourceFile | JsonSourceFile, assertionNode?: ExpectNode);
|
|
95
|
+
static fromAssertion(assertionNode: ExpectNode): DiagnosticOrigin;
|
|
96
|
+
static fromNode(node: ts.Node, assertionNode?: ExpectNode): DiagnosticOrigin;
|
|
97
|
+
static fromNodes(nodes: ts.NodeArray<ts.Node>, assertionNode?: ExpectNode): DiagnosticOrigin;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare class Diagnostic {
|
|
101
|
+
category: DiagnosticCategory;
|
|
102
|
+
code: string | undefined;
|
|
103
|
+
origin: DiagnosticOrigin | undefined;
|
|
104
|
+
related: Array<Diagnostic> | undefined;
|
|
105
|
+
text: string | Array<string>;
|
|
106
|
+
constructor(text: string | Array<string>, category: DiagnosticCategory, origin?: DiagnosticOrigin);
|
|
107
|
+
add(options: {
|
|
108
|
+
code?: string | undefined;
|
|
109
|
+
related?: Array<Diagnostic> | undefined;
|
|
110
|
+
}): this;
|
|
111
|
+
static error(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
112
|
+
extendWith(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
113
|
+
static fromDiagnostics(diagnostics: Array<ts.Diagnostic>): Array<Diagnostic>;
|
|
114
|
+
static warning(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare function diagnosticBelongsToNode(diagnostic: ts.Diagnostic, node: ts.NodeArray<ts.Node> | ts.Node): boolean;
|
|
118
|
+
declare function getDiagnosticMessageText(diagnostic: ts.Diagnostic): string | Array<string>;
|
|
119
|
+
declare function getTextSpanEnd(span: ts.TextSpan): number;
|
|
120
|
+
declare function isDiagnosticWithLocation(diagnostic: ts.Diagnostic): diagnostic is ts.DiagnosticWithLocation;
|
|
121
|
+
|
|
122
|
+
type DiagnosticsHandler<T extends Diagnostic | Array<Diagnostic> = Diagnostic> = (this: void, diagnostics: T) => void;
|
|
123
|
+
|
|
124
|
+
declare class JsonSourceFile {
|
|
125
|
+
#private;
|
|
126
|
+
fileName: string;
|
|
127
|
+
text: string;
|
|
128
|
+
constructor(fileName: string, text: string);
|
|
129
|
+
getLineStarts(): Array<number>;
|
|
130
|
+
getLineAndCharacterOfPosition(position: number): {
|
|
131
|
+
line: number;
|
|
132
|
+
character: number;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
23
136
|
interface CommandLineOptions {
|
|
24
137
|
config?: string;
|
|
25
138
|
failFast?: boolean;
|
|
@@ -53,6 +166,7 @@ interface ConfigFileOptions {
|
|
|
53
166
|
testFileMatch?: Array<string>;
|
|
54
167
|
tsconfig?: string;
|
|
55
168
|
}
|
|
169
|
+
|
|
56
170
|
interface InlineConfig {
|
|
57
171
|
fixme?: boolean;
|
|
58
172
|
if?: {
|
|
@@ -139,64 +253,6 @@ declare enum OptionGroup {
|
|
|
139
253
|
ResolvedConfig = 6
|
|
140
254
|
}
|
|
141
255
|
|
|
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
256
|
interface BaseOptionDefinition {
|
|
201
257
|
brand: OptionBrand;
|
|
202
258
|
description: string;
|
|
@@ -222,88 +278,6 @@ declare class Options {
|
|
|
222
278
|
static validate(optionName: string, optionValue: string, onDiagnostics: DiagnosticsHandler, origin?: DiagnosticOrigin): Promise<void>;
|
|
223
279
|
}
|
|
224
280
|
|
|
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
281
|
interface EnvironmentOptions {
|
|
308
282
|
isCi: boolean;
|
|
309
283
|
noColor: boolean;
|
|
@@ -344,42 +318,53 @@ declare class WatchReporter extends BaseReporter {
|
|
|
344
318
|
on([event, payload]: ReporterEvent): void;
|
|
345
319
|
}
|
|
346
320
|
|
|
347
|
-
declare class ResultTiming {
|
|
348
|
-
end: number;
|
|
349
|
-
start: number;
|
|
350
|
-
get duration(): number;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
321
|
declare enum ResultStatus {
|
|
354
322
|
Runs = "runs",
|
|
355
323
|
Passed = "passed",
|
|
324
|
+
Matched = "matched",
|
|
356
325
|
Failed = "failed",
|
|
357
|
-
Skipped = "skipped",
|
|
358
326
|
Fixme = "fixme",
|
|
327
|
+
Skipped = "skipped",
|
|
328
|
+
Ignored = "ignored",
|
|
359
329
|
Todo = "todo"
|
|
360
330
|
}
|
|
361
331
|
|
|
332
|
+
type TargetResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
333
|
+
type TargetCounts = {
|
|
334
|
+
[K in Exclude<TargetResultStatus, ResultStatus.Runs>]: number;
|
|
335
|
+
};
|
|
336
|
+
type FileResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
337
|
+
type FileCounts = {
|
|
338
|
+
[K in Exclude<FileResultStatus, ResultStatus.Runs>]: number;
|
|
339
|
+
};
|
|
340
|
+
type TestResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed | ResultStatus.Skipped | ResultStatus.Fixme | ResultStatus.Todo;
|
|
341
|
+
type TestCounts = {
|
|
342
|
+
[K in Exclude<TestResultStatus, ResultStatus.Runs>]: number;
|
|
343
|
+
};
|
|
344
|
+
type AssertionResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed | ResultStatus.Skipped | ResultStatus.Fixme | ResultStatus.Todo;
|
|
345
|
+
type AssertionCounts = {
|
|
346
|
+
[K in Exclude<AssertionResultStatus, ResultStatus.Runs>]: number;
|
|
347
|
+
};
|
|
348
|
+
type SuppressedResultStatus = ResultStatus.Matched | ResultStatus.Failed | ResultStatus.Ignored;
|
|
349
|
+
type SuppressedCounts = {
|
|
350
|
+
[K in SuppressedResultStatus]: number;
|
|
351
|
+
};
|
|
352
|
+
type ResultCounts = TargetCounts | FileCounts | TestCounts | AssertionCounts | SuppressedCounts;
|
|
353
|
+
interface ResultTiming {
|
|
354
|
+
start: number;
|
|
355
|
+
end: number;
|
|
356
|
+
}
|
|
357
|
+
|
|
362
358
|
declare class ExpectResult {
|
|
363
359
|
expect: ExpectNode;
|
|
364
|
-
diagnostics: Array<Diagnostic>;
|
|
365
360
|
parent: TestResult | undefined;
|
|
366
|
-
status:
|
|
361
|
+
status: AssertionResultStatus;
|
|
367
362
|
timing: ResultTiming;
|
|
368
363
|
constructor(expect: ExpectNode, parent?: TestResult);
|
|
369
364
|
}
|
|
370
365
|
|
|
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
366
|
declare class TestResult {
|
|
381
|
-
|
|
382
|
-
expectCount: ResultCount;
|
|
367
|
+
assertionCounts: AssertionCounts;
|
|
383
368
|
parent: DescribeResult | undefined;
|
|
384
369
|
results: Array<ExpectResult>;
|
|
385
370
|
status: ResultStatus;
|
|
@@ -403,27 +388,24 @@ declare class FileLocation {
|
|
|
403
388
|
constructor(file: string | URL, position?: number);
|
|
404
389
|
}
|
|
405
390
|
|
|
406
|
-
type FileResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
407
391
|
declare class FileResult {
|
|
408
|
-
|
|
409
|
-
expectCount: ResultCount;
|
|
392
|
+
assertionCounts: AssertionCounts;
|
|
410
393
|
file: FileLocation;
|
|
411
394
|
results: Array<DescribeResult | TestResult | ExpectResult>;
|
|
395
|
+
suppressedCounts: SuppressedCounts;
|
|
412
396
|
status: FileResultStatus;
|
|
413
|
-
|
|
397
|
+
testCounts: TestCounts;
|
|
414
398
|
timing: ResultTiming;
|
|
415
399
|
constructor(file: FileLocation);
|
|
416
400
|
}
|
|
417
401
|
|
|
418
402
|
declare class ProjectResult {
|
|
419
403
|
compilerVersion: string;
|
|
420
|
-
diagnostics: Array<Diagnostic>;
|
|
421
404
|
projectConfigFilePath: string | undefined;
|
|
422
405
|
results: Array<FileResult>;
|
|
423
406
|
constructor(compilerVersion: string, projectConfigFilePath: string | undefined);
|
|
424
407
|
}
|
|
425
408
|
|
|
426
|
-
type TargetResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
427
409
|
declare class TargetResult {
|
|
428
410
|
files: Array<FileLocation>;
|
|
429
411
|
results: Map<string | undefined, ProjectResult>;
|
|
@@ -434,16 +416,22 @@ declare class TargetResult {
|
|
|
434
416
|
}
|
|
435
417
|
|
|
436
418
|
declare class Result {
|
|
437
|
-
|
|
438
|
-
|
|
419
|
+
assertionCounts: AssertionCounts;
|
|
420
|
+
fileCounts: FileCounts;
|
|
439
421
|
files: Array<FileLocation>;
|
|
440
422
|
results: Array<TargetResult>;
|
|
441
|
-
|
|
442
|
-
|
|
423
|
+
suppressedCounts: SuppressedCounts;
|
|
424
|
+
targetCounts: TargetCounts;
|
|
425
|
+
testCounts: TestCounts;
|
|
443
426
|
timing: ResultTiming;
|
|
444
427
|
constructor(files: Array<FileLocation>);
|
|
445
428
|
}
|
|
446
429
|
|
|
430
|
+
declare class SuppressedResult {
|
|
431
|
+
suppressed: SuppressedError;
|
|
432
|
+
constructor(suppressed: SuppressedError);
|
|
433
|
+
}
|
|
434
|
+
|
|
447
435
|
interface EventHandler {
|
|
448
436
|
on: (event: Event) => void;
|
|
449
437
|
}
|
|
@@ -519,6 +507,13 @@ type Event = ["config:error", {
|
|
|
519
507
|
result: ExpectResult;
|
|
520
508
|
}] | ["expect:fixme", {
|
|
521
509
|
result: ExpectResult;
|
|
510
|
+
}] | ["suppressed:error", {
|
|
511
|
+
diagnostics: Array<Diagnostic>;
|
|
512
|
+
result: SuppressedResult;
|
|
513
|
+
}] | ["suppressed:match", {
|
|
514
|
+
result: SuppressedResult;
|
|
515
|
+
}] | ["suppressed:ignore", {
|
|
516
|
+
result: SuppressedResult;
|
|
522
517
|
}] | ["watch:error", {
|
|
523
518
|
diagnostics: Array<Diagnostic>;
|
|
524
519
|
}];
|
|
@@ -536,65 +531,6 @@ declare class EventEmitter {
|
|
|
536
531
|
removeReporters(): void;
|
|
537
532
|
}
|
|
538
533
|
|
|
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
534
|
declare enum Color {
|
|
599
535
|
Reset = "0",
|
|
600
536
|
Red = "31",
|
|
@@ -678,15 +614,17 @@ declare class OutputService {
|
|
|
678
614
|
static writeWarning(element: ScribblerJsx.Element | Array<ScribblerJsx.Element>): void;
|
|
679
615
|
}
|
|
680
616
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
617
|
+
interface SummaryTextOptions {
|
|
618
|
+
targetCounts: ResultCounts;
|
|
619
|
+
fileCounts: ResultCounts;
|
|
620
|
+
testCounts: ResultCounts;
|
|
621
|
+
assertionCounts: ResultCounts;
|
|
622
|
+
suppressedCounts: SuppressedCounts;
|
|
623
|
+
timing: ResultTiming;
|
|
624
|
+
}
|
|
625
|
+
declare function summaryText({ targetCounts, fileCounts, testCounts, assertionCounts, suppressedCounts, timing, }: SummaryTextOptions): ScribblerJsx.Element;
|
|
688
626
|
|
|
689
|
-
declare function testNameText(status:
|
|
627
|
+
declare function testNameText(status: Exclude<TestResultStatus, ResultStatus.Runs>, name: string, indent?: number): ScribblerJsx.Element;
|
|
690
628
|
|
|
691
629
|
declare function usesCompilerText(compilerVersion: string, projectConfigFilePath: string | undefined, options?: {
|
|
692
630
|
prependEmptyLine: boolean;
|
|
@@ -785,11 +723,6 @@ declare class Store {
|
|
|
785
723
|
static validateTag(tag: string): Promise<boolean | undefined>;
|
|
786
724
|
}
|
|
787
725
|
|
|
788
|
-
declare class SuppressedService {
|
|
789
|
-
#private;
|
|
790
|
-
match(testTree: TestTree, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): void;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
726
|
declare class Version {
|
|
794
727
|
#private;
|
|
795
728
|
static isGreaterThan(source: string, target: string): boolean;
|
|
@@ -797,33 +730,5 @@ declare class Version {
|
|
|
797
730
|
static isSatisfiedWith(source: string, target: string): boolean;
|
|
798
731
|
}
|
|
799
732
|
|
|
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 };
|
|
733
|
+
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 };
|
|
734
|
+
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 };
|