tstyche 4.3.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.
@@ -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;
@@ -40,7 +153,7 @@ interface CommandLineOptions {
40
153
  watch?: boolean;
41
154
  }
42
155
  interface ConfigFileOptions {
43
- checkSourceFiles?: boolean;
156
+ checkDeclarationFiles?: boolean;
44
157
  checkSuppressedErrors?: boolean;
45
158
  failFast?: boolean;
46
159
  fixtureFileMatch?: Array<string>;
@@ -53,7 +166,9 @@ interface ConfigFileOptions {
53
166
  testFileMatch?: Array<string>;
54
167
  tsconfig?: string;
55
168
  }
169
+
56
170
  interface InlineConfig {
171
+ fixme?: boolean;
57
172
  if?: {
58
173
  target?: Array<string>;
59
174
  };
@@ -63,6 +178,17 @@ interface ResolvedConfig extends Omit<CommandLineOptions, "config" | keyof Confi
63
178
  configFilePath: string;
64
179
  pathMatch: Array<string>;
65
180
  }
181
+ interface TextRange {
182
+ start: number;
183
+ end: number;
184
+ text: string;
185
+ }
186
+ interface DirectiveRange {
187
+ sourceFile: ts.SourceFile;
188
+ namespace: TextRange;
189
+ directive?: TextRange;
190
+ argument?: TextRange;
191
+ }
66
192
 
67
193
  declare class Config {
68
194
  #private;
@@ -85,9 +211,10 @@ declare class Config {
85
211
 
86
212
  declare enum OptionBrand {
87
213
  String = "string",
214
+ SemverRange = "range",
88
215
  Number = "number",
89
216
  Boolean = "boolean",
90
- BareTrue = "bareTrue",
217
+ True = "true",
91
218
  List = "list"
92
219
  }
93
220
 
@@ -99,34 +226,22 @@ declare class ConfigDiagnosticText {
99
226
  static fileMatchPatternCannotStartWith(optionName: string, segment: string): Array<string>;
100
227
  static inspectSupportedVersions(): string;
101
228
  static moduleWasNotFound(specifier: string): string;
229
+ static optionValueMustBe(optionName: string, optionBrand: OptionBrand): string;
102
230
  static rangeIsNotValid(value: string): string;
231
+ static rangeDoesNotMatchSupported(value: string): string;
103
232
  static rangeUsage(): Array<string>;
104
- static requiresValueType(optionName: string, optionBrand: OptionBrand): string;
105
233
  static seen(element: string): string;
106
234
  static unexpected(element: string): string;
107
235
  static unknownOption(optionName: string): string;
108
- static usage(optionName: string, optionBrand: OptionBrand): Array<string>;
109
236
  static versionIsNotSupported(value: string): string;
110
237
  static watchCannotBeEnabled(): string;
111
238
  }
112
239
 
113
- interface TextRange {
114
- start: number;
115
- end: number;
116
- text: string;
117
- }
118
- interface DirectiveRange {
119
- namespace: TextRange;
120
- directive?: TextRange;
121
- argument?: TextRange;
122
- }
123
- type DirectiveRanges = Array<DirectiveRange> & {
124
- sourceFile: ts.SourceFile;
125
- };
126
240
  declare class Directive {
127
241
  #private;
128
- static getDirectiveRanges(compiler: typeof ts, sourceFile: ts.SourceFile, position?: number): DirectiveRanges | undefined;
129
- static getInlineConfig(ranges: DirectiveRanges | undefined): Promise<InlineConfig | undefined>;
242
+ static getDirectiveRange(compiler: typeof ts, owner: TestTreeNode, directiveText: string): DirectiveRange | undefined;
243
+ static getDirectiveRanges(compiler: typeof ts, node: ts.Node): Array<DirectiveRange> | undefined;
244
+ static getInlineConfig(ranges: Array<DirectiveRange> | DirectiveRange | undefined): Promise<InlineConfig | undefined>;
130
245
  }
131
246
 
132
247
  declare const defaultOptions: Required<ConfigFileOptions>;
@@ -138,58 +253,6 @@ declare enum OptionGroup {
138
253
  ResolvedConfig = 6
139
254
  }
140
255
 
141
- declare enum DiagnosticCategory {
142
- Error = "error",
143
- Warning = "warning"
144
- }
145
-
146
- declare class SourceFile {
147
- #private;
148
- fileName: string;
149
- text: string;
150
- constructor(fileName: string, text: string);
151
- getLineStarts(): Array<number>;
152
- getLineAndCharacterOfPosition(position: number): {
153
- line: number;
154
- character: number;
155
- };
156
- }
157
-
158
- declare class DiagnosticOrigin {
159
- assertion: AssertionNode | undefined;
160
- end: number;
161
- sourceFile: SourceFile | ts.SourceFile;
162
- start: number;
163
- constructor(start: number, end: number, sourceFile: SourceFile | ts.SourceFile, assertion?: AssertionNode);
164
- static fromAssertion(assertion: AssertionNode): DiagnosticOrigin;
165
- static fromNode(node: ts.Node, assertion?: AssertionNode): DiagnosticOrigin;
166
- static fromNodes(nodes: ts.NodeArray<ts.Node>, assertion?: AssertionNode): DiagnosticOrigin;
167
- }
168
-
169
- declare class Diagnostic {
170
- category: DiagnosticCategory;
171
- code: string | undefined;
172
- origin: DiagnosticOrigin | undefined;
173
- related: Array<Diagnostic> | undefined;
174
- text: string | Array<string>;
175
- constructor(text: string | Array<string>, category: DiagnosticCategory, origin?: DiagnosticOrigin);
176
- add(options: {
177
- code?: string | undefined;
178
- related?: Array<Diagnostic> | undefined;
179
- }): this;
180
- static error(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
181
- extendWith(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
182
- static fromDiagnostics(diagnostics: Array<ts.Diagnostic>, sourceFile?: ts.SourceFile): Array<Diagnostic>;
183
- static warning(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
184
- }
185
-
186
- declare function diagnosticBelongsToNode(diagnostic: ts.Diagnostic, node: ts.NodeArray<ts.Node> | ts.Node): boolean;
187
- declare function getDiagnosticMessageText(diagnostic: ts.Diagnostic): string | Array<string>;
188
- declare function getTextSpanEnd(span: ts.TextSpan): number;
189
- declare function isDiagnosticWithLocation(diagnostic: ts.Diagnostic): diagnostic is ts.DiagnosticWithLocation;
190
-
191
- type DiagnosticsHandler<T extends Diagnostic | Array<Diagnostic> = Diagnostic> = (this: void, diagnostics: T) => void;
192
-
193
256
  interface BaseOptionDefinition {
194
257
  brand: OptionBrand;
195
258
  description: string;
@@ -197,7 +260,7 @@ interface BaseOptionDefinition {
197
260
  name: string;
198
261
  }
199
262
  interface PrimitiveTypeOptionDefinition extends BaseOptionDefinition {
200
- brand: OptionBrand.String | OptionBrand.Number | OptionBrand.Boolean | OptionBrand.BareTrue;
263
+ brand: OptionBrand.String | OptionBrand.SemverRange | OptionBrand.Number | OptionBrand.Boolean | OptionBrand.True;
201
264
  }
202
265
  interface ItemDefinition {
203
266
  brand: OptionBrand.String;
@@ -212,97 +275,9 @@ declare class Options {
212
275
  #private;
213
276
  static for(optionGroup: OptionGroup): Map<string, OptionDefinition>;
214
277
  static resolve(optionName: string, optionValue: string, rootPath?: string): string;
215
- static validate(optionName: string, optionValue: string, optionBrand: OptionBrand, onDiagnostics: DiagnosticsHandler, origin?: DiagnosticOrigin): Promise<void>;
216
- }
217
-
218
- declare enum TestTreeNodeBrand {
219
- Describe = "describe",
220
- Test = "test",
221
- Expect = "expect",
222
- When = "when"
223
- }
224
-
225
- declare enum TestTreeNodeFlags {
226
- None = 0,
227
- Fail = 1,
228
- Only = 2,
229
- Skip = 4,
230
- Todo = 8
231
- }
232
-
233
- declare class WhenNode extends TestTreeNode {
234
- actionNode: ts.CallExpression;
235
- actionNameNode: ts.PropertyAccessExpression;
236
- abilityDiagnostics: Set<ts.Diagnostic>;
237
- target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
238
- constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags, actionNode: ts.CallExpression, actionNameNode: ts.PropertyAccessExpression);
239
- }
240
-
241
- declare class TestTreeNode {
242
- brand: TestTreeNodeBrand;
243
- children: Array<TestTreeNode | AssertionNode | WhenNode>;
244
- diagnostics: Set<ts.Diagnostic>;
245
- flags: TestTreeNodeFlags;
246
- name: string;
247
- node: ts.CallExpression;
248
- parent: TestTree | TestTreeNode;
249
- constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags);
250
- getDirectiveRanges(compiler: typeof ts): DirectiveRanges | undefined;
251
- }
252
-
253
- interface SuppressedError {
254
- directive: TextRange;
255
- ignore: boolean;
256
- argument?: TextRange;
257
- diagnostics: Array<ts.Diagnostic>;
258
- }
259
- type SuppressedErrors = Array<SuppressedError> & {
260
- sourceFile: ts.SourceFile;
261
- };
262
-
263
- declare class TestTree {
264
- children: Array<TestTreeNode | AssertionNode | WhenNode>;
265
- diagnostics: Set<ts.Diagnostic>;
266
- hasOnly: boolean;
267
- sourceFile: ts.SourceFile;
268
- suppressedErrors: SuppressedErrors | undefined;
269
- constructor(diagnostics: Set<ts.Diagnostic>, sourceFile: ts.SourceFile);
270
- getDirectiveRanges(compiler: typeof ts): DirectiveRanges | undefined;
271
- }
272
-
273
- declare class AssertionNode extends TestTreeNode {
274
- abilityDiagnostics: Set<ts.Diagnostic>;
275
- isNot: boolean;
276
- matcherNode: ts.CallExpression | ts.Decorator;
277
- matcherNameNode: ts.PropertyAccessExpression;
278
- modifierNode: ts.PropertyAccessExpression;
279
- notNode: ts.PropertyAccessExpression | undefined;
280
- source: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
281
- target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode> | undefined;
282
- 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);
283
- }
284
-
285
- declare class ProjectService {
286
- #private;
287
- constructor(compiler: typeof ts, resolvedConfig: ResolvedConfig);
288
- closeFile(filePath: string): void;
289
- getDefaultProject(filePath: string): ts.server.Project | undefined;
290
- getLanguageService(filePath: string): ts.LanguageService | undefined;
291
- openFile(filePath: string, sourceText?: string | undefined, projectRootPath?: string | undefined): void;
278
+ static validate(optionName: string, optionValue: string, onDiagnostics: DiagnosticsHandler, origin?: DiagnosticOrigin): Promise<void>;
292
279
  }
293
280
 
294
- declare class CollectService {
295
- #private;
296
- constructor(compiler: typeof ts, projectService: ProjectService, resolvedConfig: ResolvedConfig);
297
- createTestTree(sourceFile: ts.SourceFile, semanticDiagnostics?: Array<ts.Diagnostic>): TestTree;
298
- }
299
-
300
- declare function nodeBelongsToArgumentList(compiler: typeof ts, node: ts.Node): boolean;
301
-
302
- declare function argumentIsProvided<T>(argumentNameText: string, node: T, enclosingNode: ts.Node, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): node is NonNullable<T>;
303
-
304
- declare function argumentOrTypeArgumentIsProvided<T>(argumentNameText: string, typeArgumentNameText: string, node: T, enclosingNode: ts.Node, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): node is NonNullable<T>;
305
-
306
281
  interface EnvironmentOptions {
307
282
  isCi: boolean;
308
283
  noColor: boolean;
@@ -343,40 +318,53 @@ declare class WatchReporter extends BaseReporter {
343
318
  on([event, payload]: ReporterEvent): void;
344
319
  }
345
320
 
346
- declare class ResultTiming {
347
- end: number;
348
- start: number;
349
- get duration(): number;
350
- }
351
-
352
321
  declare enum ResultStatus {
353
322
  Runs = "runs",
354
323
  Passed = "passed",
324
+ Matched = "matched",
355
325
  Failed = "failed",
326
+ Fixme = "fixme",
356
327
  Skipped = "skipped",
328
+ Ignored = "ignored",
357
329
  Todo = "todo"
358
330
  }
359
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
+
360
358
  declare class ExpectResult {
361
- assertion: AssertionNode;
362
- diagnostics: Array<Diagnostic>;
359
+ expect: ExpectNode;
363
360
  parent: TestResult | undefined;
364
- status: ResultStatus;
361
+ status: AssertionResultStatus;
365
362
  timing: ResultTiming;
366
- constructor(assertion: AssertionNode, parent?: TestResult);
367
- }
368
-
369
- declare class ResultCount {
370
- failed: number;
371
- passed: number;
372
- skipped: number;
373
- todo: number;
374
- get total(): number;
363
+ constructor(expect: ExpectNode, parent?: TestResult);
375
364
  }
376
365
 
377
366
  declare class TestResult {
378
- diagnostics: Array<Diagnostic>;
379
- expectCount: ResultCount;
367
+ assertionCounts: AssertionCounts;
380
368
  parent: DescribeResult | undefined;
381
369
  results: Array<ExpectResult>;
382
370
  status: ResultStatus;
@@ -393,52 +381,55 @@ declare class DescribeResult {
393
381
  constructor(describe: TestTreeNode, parent?: DescribeResult);
394
382
  }
395
383
 
396
- declare class Task {
384
+ declare class FileLocation {
397
385
  #private;
398
- filePath: string;
386
+ path: string;
399
387
  position: number | undefined;
400
- constructor(filePath: string | URL, position?: number);
388
+ constructor(file: string | URL, position?: number);
401
389
  }
402
390
 
403
- type TaskResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
404
- declare class TaskResult {
405
- diagnostics: Array<Diagnostic>;
406
- expectCount: ResultCount;
391
+ declare class FileResult {
392
+ assertionCounts: AssertionCounts;
393
+ file: FileLocation;
407
394
  results: Array<DescribeResult | TestResult | ExpectResult>;
408
- status: TaskResultStatus;
409
- task: Task;
410
- testCount: ResultCount;
395
+ suppressedCounts: SuppressedCounts;
396
+ status: FileResultStatus;
397
+ testCounts: TestCounts;
411
398
  timing: ResultTiming;
412
- constructor(task: Task);
399
+ constructor(file: FileLocation);
413
400
  }
414
401
 
415
402
  declare class ProjectResult {
416
403
  compilerVersion: string;
417
- diagnostics: Array<Diagnostic>;
418
404
  projectConfigFilePath: string | undefined;
419
- results: Array<TaskResult>;
405
+ results: Array<FileResult>;
420
406
  constructor(compilerVersion: string, projectConfigFilePath: string | undefined);
421
407
  }
422
408
 
423
- type TargetResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
424
409
  declare class TargetResult {
410
+ files: Array<FileLocation>;
425
411
  results: Map<string | undefined, ProjectResult>;
426
412
  status: TargetResultStatus;
427
413
  target: string;
428
- tasks: Array<Task>;
429
414
  timing: ResultTiming;
430
- constructor(target: string, tasks: Array<Task>);
415
+ constructor(target: string, files: Array<FileLocation>);
431
416
  }
432
417
 
433
418
  declare class Result {
434
- expectCount: ResultCount;
435
- fileCount: ResultCount;
419
+ assertionCounts: AssertionCounts;
420
+ fileCounts: FileCounts;
421
+ files: Array<FileLocation>;
436
422
  results: Array<TargetResult>;
437
- targetCount: ResultCount;
438
- tasks: Array<Task>;
439
- testCount: ResultCount;
423
+ suppressedCounts: SuppressedCounts;
424
+ targetCounts: TargetCounts;
425
+ testCounts: TestCounts;
440
426
  timing: ResultTiming;
441
- constructor(tasks: Array<Task>);
427
+ constructor(files: Array<FileLocation>);
428
+ }
429
+
430
+ declare class SuppressedResult {
431
+ suppressed: SuppressedError;
432
+ constructor(suppressed: SuppressedError);
442
433
  }
443
434
 
444
435
  interface EventHandler {
@@ -466,13 +457,13 @@ type Event = ["config:error", {
466
457
  projectConfigFilePath: string | undefined;
467
458
  }] | ["project:error", {
468
459
  diagnostics: Array<Diagnostic>;
469
- }] | ["task:start", {
470
- result: TaskResult;
471
- }] | ["task:error", {
460
+ }] | ["file:start", {
461
+ result: FileResult;
462
+ }] | ["file:error", {
472
463
  diagnostics: Array<Diagnostic>;
473
- result: TaskResult;
474
- }] | ["task:end", {
475
- result: TaskResult;
464
+ result: FileResult;
465
+ }] | ["file:end", {
466
+ result: FileResult;
476
467
  }] | ["directive:error", {
477
468
  diagnostics: Array<Diagnostic>;
478
469
  }] | ["collect:start", {
@@ -480,7 +471,7 @@ type Event = ["config:error", {
480
471
  }] | ["collect:error", {
481
472
  diagnostics: Array<Diagnostic>;
482
473
  }] | ["collect:node", {
483
- node: TestTreeNode | AssertionNode | WhenNode;
474
+ node: TestTreeNode | ExpectNode | WhenNode;
484
475
  }] | ["collect:end", {
485
476
  tree: TestTree;
486
477
  }] | ["describe:start", {
@@ -498,6 +489,8 @@ type Event = ["config:error", {
498
489
  result: TestResult;
499
490
  }] | ["test:skip", {
500
491
  result: TestResult;
492
+ }] | ["test:fixme", {
493
+ result: TestResult;
501
494
  }] | ["test:todo", {
502
495
  result: TestResult;
503
496
  }] | ["expect:start", {
@@ -512,6 +505,15 @@ type Event = ["config:error", {
512
505
  result: ExpectResult;
513
506
  }] | ["expect:skip", {
514
507
  result: ExpectResult;
508
+ }] | ["expect:fixme", {
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;
515
517
  }] | ["watch:error", {
516
518
  diagnostics: Array<Diagnostic>;
517
519
  }];
@@ -529,65 +531,6 @@ declare class EventEmitter {
529
531
  removeReporters(): void;
530
532
  }
531
533
 
532
- declare class Reject {
533
- #private;
534
- constructor(compiler: typeof ts, typeChecker: ts.TypeChecker, resolvedConfig: ResolvedConfig);
535
- argumentType(target: Array<[name: string, node: ts.Expression | ts.TypeNode | undefined]>, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): boolean;
536
- }
537
-
538
- interface MatchResult {
539
- explain: () => Array<Diagnostic>;
540
- isMatch: boolean;
541
- }
542
- interface TypeChecker extends ts.TypeChecker {
543
- isApplicableIndexType: (source: ts.Type, target: ts.Type) => boolean;
544
- isTypeIdenticalTo: (source: ts.Type, target: ts.Type) => boolean;
545
- }
546
-
547
- declare class ExpectService {
548
- #private;
549
- private toAcceptProps;
550
- private toBe;
551
- private toBeApplicable;
552
- private toBeAssignableTo;
553
- private toBeAssignableWith;
554
- private toBeCallableWith;
555
- private toBeConstructableWith;
556
- private toHaveProperty;
557
- private toRaiseError;
558
- constructor(compiler: typeof ts, typeChecker: TypeChecker, reject: Reject);
559
- match(assertion: AssertionNode, onDiagnostics: DiagnosticsHandler<Diagnostic | Array<Diagnostic>>): MatchResult | undefined;
560
- }
561
-
562
- declare class Glob {
563
- #private;
564
- static toRegex(patterns: Array<string>, target: "directories" | "files"): RegExp;
565
- }
566
-
567
- declare class CancellationHandler implements EventHandler {
568
- #private;
569
- constructor(cancellationToken: CancellationToken, cancellationReason: CancellationReason);
570
- on([, payload]: Event): void;
571
- }
572
-
573
- declare class ExitCodeHandler implements EventHandler {
574
- #private;
575
- on([event, payload]: Event): void;
576
- resetCode(): void;
577
- }
578
-
579
- declare class ResultHandler implements EventHandler {
580
- #private;
581
- on([event, payload]: Event): void;
582
- }
583
-
584
- type InputHandler = (chunk: string) => void;
585
- declare class InputService {
586
- #private;
587
- constructor(onInput: InputHandler);
588
- close(): void;
589
- }
590
-
591
534
  declare enum Color {
592
535
  Reset = "0",
593
536
  Red = "31",
@@ -654,6 +597,8 @@ interface CodeFrameOptions {
654
597
 
655
598
  declare function diagnosticText(diagnostic: Diagnostic, codeFrameOptions?: CodeFrameOptions): ScribblerJsx.Element;
656
599
 
600
+ declare function fileStatusText(status: FileResultStatus, file: FileLocation): ScribblerJsx.Element;
601
+
657
602
  declare function fileViewText(lines: Array<ScribblerJsx.Element>, addEmptyFinalLine: boolean): ScribblerJsx.Element;
658
603
 
659
604
  declare function formattedText(input: string | Array<string> | Record<string, unknown>): ScribblerJsx.Element;
@@ -669,17 +614,17 @@ declare class OutputService {
669
614
  static writeWarning(element: ScribblerJsx.Element | Array<ScribblerJsx.Element>): void;
670
615
  }
671
616
 
672
- declare function summaryText({ duration, expectCount, fileCount, targetCount, testCount, }: {
673
- duration: number;
674
- expectCount: ResultCount;
675
- fileCount: ResultCount;
676
- targetCount: ResultCount;
677
- testCount: ResultCount;
678
- }): ScribblerJsx.Element;
679
-
680
- declare function taskStatusText(status: TaskResultStatus, task: Task): ScribblerJsx.Element;
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;
681
626
 
682
- declare function testNameText(status: "fail" | "pass" | "skip" | "todo", name: string, indent?: number): ScribblerJsx.Element;
627
+ declare function testNameText(status: Exclude<TestResultStatus, ResultStatus.Runs>, name: string, indent?: number): ScribblerJsx.Element;
683
628
 
684
629
  declare function usesCompilerText(compilerVersion: string, projectConfigFilePath: string | undefined, options?: {
685
630
  prependEmptyLine: boolean;
@@ -718,7 +663,7 @@ declare class Runner {
718
663
  #private;
719
664
  static version: string;
720
665
  constructor(resolvedConfig: ResolvedConfig);
721
- run(testFiles: Array<string | URL | Task>, cancellationToken?: CancellationToken): Promise<void>;
666
+ run(files: Array<string | URL | FileLocation>, cancellationToken?: CancellationToken): Promise<void>;
722
667
  }
723
668
 
724
669
  declare class Select {
@@ -778,10 +723,6 @@ declare class Store {
778
723
  static validateTag(tag: string): Promise<boolean | undefined>;
779
724
  }
780
725
 
781
- declare class SuppressedService {
782
- match(suppressedErrors: SuppressedErrors, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): void;
783
- }
784
-
785
726
  declare class Version {
786
727
  #private;
787
728
  static isGreaterThan(source: string, target: string): boolean;
@@ -789,33 +730,5 @@ declare class Version {
789
730
  static isSatisfiedWith(source: string, target: string): boolean;
790
731
  }
791
732
 
792
- type WatchHandler = (filePath: string) => void;
793
- interface WatcherOptions {
794
- recursive?: boolean;
795
- }
796
- declare class Watcher {
797
- #private;
798
- constructor(targetPath: string, onChanged: WatchHandler, onRemoved?: WatchHandler, options?: WatcherOptions);
799
- close(): void;
800
- watch(): void;
801
- }
802
-
803
- type FileWatchHandler = () => void;
804
- declare class FileWatcher extends Watcher {
805
- constructor(targetPath: string, onChanged: FileWatchHandler);
806
- }
807
-
808
- declare class WatchService {
809
- #private;
810
- constructor(resolvedConfig: ResolvedConfig, tasks: Array<Task>);
811
- watch(cancellationToken: CancellationToken): AsyncIterable<Array<Task>>;
812
- }
813
-
814
- declare class WhenService {
815
- #private;
816
- constructor(reject: Reject, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>);
817
- action(when: WhenNode): void;
818
- }
819
-
820
- export { AssertionNode, BaseReporter, CancellationHandler, CancellationReason, CancellationToken, Cli, CollectService, Color, Config, ConfigDiagnosticText, DescribeResult, Diagnostic, DiagnosticCategory, DiagnosticOrigin, Directive, EventEmitter, ExitCodeHandler, ExpectResult, ExpectService, 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, Store, SummaryReporter, SuppressedService, TargetResult, Task, TaskResult, TestResult, TestTree, TestTreeNode, TestTreeNodeBrand, TestTreeNodeFlags, Text, Version, WatchReporter, WatchService, Watcher, WhenNode, WhenService, addsPackageText, argumentIsProvided, argumentOrTypeArgumentIsProvided, defaultOptions, describeNameText, diagnosticBelongsToNode, diagnosticText, environmentOptions, fileViewText, formattedText, getDiagnosticMessageText, getTextSpanEnd, helpText, isDiagnosticWithLocation, nodeBelongsToArgumentList, summaryText, taskStatusText, testNameText, usesCompilerText, waitingForFileChangesText, watchUsageText };
821
- export type { CodeFrameOptions, CommandLineOptions, ConfigFileOptions, DiagnosticsHandler, DirectiveRange, DirectiveRanges, EnvironmentOptions, Event, EventHandler, FileWatchHandler, InlineConfig, InputHandler, ItemDefinition, MatchResult, OptionDefinition, Plugin, Reporter, ReporterEvent, ResolvedConfig, ScribblerOptions, SelectHookContext, SuppressedError, SuppressedErrors, TargetResultStatus, TaskResultStatus, 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 };