tstyche 4.2.0 → 5.0.0-beta.0
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/index.d.cts +0 -42
- package/build/index.d.ts +0 -42
- package/build/tstyche.d.ts +103 -93
- package/build/tstyche.js +1054 -866
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ Here is the list of all matchers:
|
|
|
74
74
|
|
|
75
75
|
## Runner
|
|
76
76
|
|
|
77
|
-
The `tstyche` command is the heart of TSTyche. For example, it can select test files by path, filter tests by name and
|
|
77
|
+
The `tstyche` command is the heart of TSTyche. For example, it can select test files by path, filter tests by name and to run the tests against specific versions of TypeScript:
|
|
78
78
|
|
|
79
79
|
```shell
|
|
80
80
|
tstyche query-params --only multiple --target '>=5.0 <5.3'
|
package/build/index.d.cts
CHANGED
|
@@ -168,20 +168,6 @@ interface Expect {
|
|
|
168
168
|
* @param source - The expression against which type the assertion is made.
|
|
169
169
|
*/
|
|
170
170
|
(source: unknown): Modifier;
|
|
171
|
-
fail: {
|
|
172
|
-
/**
|
|
173
|
-
* Mark an assertion as supposed to fail.
|
|
174
|
-
*
|
|
175
|
-
* @template Source - The type against which the assertion is made.
|
|
176
|
-
*/
|
|
177
|
-
<Source>(): Modifier;
|
|
178
|
-
/**
|
|
179
|
-
* Mark an assertion as supposed to fail.
|
|
180
|
-
*
|
|
181
|
-
* @param source - The expression against which type the assertion is made.
|
|
182
|
-
*/
|
|
183
|
-
(source: unknown): Modifier;
|
|
184
|
-
};
|
|
185
171
|
/**
|
|
186
172
|
* Marks an assertion as focused.
|
|
187
173
|
*/
|
|
@@ -198,20 +184,6 @@ interface Expect {
|
|
|
198
184
|
* @param source - The expression against which type the assertion is made.
|
|
199
185
|
*/
|
|
200
186
|
(source: unknown): Modifier;
|
|
201
|
-
fail: {
|
|
202
|
-
/**
|
|
203
|
-
* Mark an assertion as supposed to fail.
|
|
204
|
-
*
|
|
205
|
-
* @template Source - The type against which the assertion is made.
|
|
206
|
-
*/
|
|
207
|
-
<Source>(): Modifier;
|
|
208
|
-
/**
|
|
209
|
-
* Mark an assertion as supposed to fail.
|
|
210
|
-
*
|
|
211
|
-
* @param source - The expression against which type the assertion is made.
|
|
212
|
-
*/
|
|
213
|
-
(source: unknown): Modifier;
|
|
214
|
-
};
|
|
215
187
|
};
|
|
216
188
|
/**
|
|
217
189
|
* Marks an assertion as skipped.
|
|
@@ -229,20 +201,6 @@ interface Expect {
|
|
|
229
201
|
* @param source - The expression against which type the assertion is made.
|
|
230
202
|
*/
|
|
231
203
|
(source: unknown): Modifier;
|
|
232
|
-
fail: {
|
|
233
|
-
/**
|
|
234
|
-
* Marks an assertion as supposed to fail.
|
|
235
|
-
*
|
|
236
|
-
* @template Source - The type against which the assertion is made.
|
|
237
|
-
*/
|
|
238
|
-
<Source>(): Modifier;
|
|
239
|
-
/**
|
|
240
|
-
* Marks an assertion as supposed to fail.
|
|
241
|
-
*
|
|
242
|
-
* @param source - The expression against which type the assertion is made.
|
|
243
|
-
*/
|
|
244
|
-
(source: unknown): Modifier;
|
|
245
|
-
};
|
|
246
204
|
};
|
|
247
205
|
}
|
|
248
206
|
/**
|
package/build/index.d.ts
CHANGED
|
@@ -168,20 +168,6 @@ interface Expect {
|
|
|
168
168
|
* @param source - The expression against which type the assertion is made.
|
|
169
169
|
*/
|
|
170
170
|
(source: unknown): Modifier;
|
|
171
|
-
fail: {
|
|
172
|
-
/**
|
|
173
|
-
* Mark an assertion as supposed to fail.
|
|
174
|
-
*
|
|
175
|
-
* @template Source - The type against which the assertion is made.
|
|
176
|
-
*/
|
|
177
|
-
<Source>(): Modifier;
|
|
178
|
-
/**
|
|
179
|
-
* Mark an assertion as supposed to fail.
|
|
180
|
-
*
|
|
181
|
-
* @param source - The expression against which type the assertion is made.
|
|
182
|
-
*/
|
|
183
|
-
(source: unknown): Modifier;
|
|
184
|
-
};
|
|
185
171
|
/**
|
|
186
172
|
* Marks an assertion as focused.
|
|
187
173
|
*/
|
|
@@ -198,20 +184,6 @@ interface Expect {
|
|
|
198
184
|
* @param source - The expression against which type the assertion is made.
|
|
199
185
|
*/
|
|
200
186
|
(source: unknown): Modifier;
|
|
201
|
-
fail: {
|
|
202
|
-
/**
|
|
203
|
-
* Mark an assertion as supposed to fail.
|
|
204
|
-
*
|
|
205
|
-
* @template Source - The type against which the assertion is made.
|
|
206
|
-
*/
|
|
207
|
-
<Source>(): Modifier;
|
|
208
|
-
/**
|
|
209
|
-
* Mark an assertion as supposed to fail.
|
|
210
|
-
*
|
|
211
|
-
* @param source - The expression against which type the assertion is made.
|
|
212
|
-
*/
|
|
213
|
-
(source: unknown): Modifier;
|
|
214
|
-
};
|
|
215
187
|
};
|
|
216
188
|
/**
|
|
217
189
|
* Marks an assertion as skipped.
|
|
@@ -229,20 +201,6 @@ interface Expect {
|
|
|
229
201
|
* @param source - The expression against which type the assertion is made.
|
|
230
202
|
*/
|
|
231
203
|
(source: unknown): Modifier;
|
|
232
|
-
fail: {
|
|
233
|
-
/**
|
|
234
|
-
* Marks an assertion as supposed to fail.
|
|
235
|
-
*
|
|
236
|
-
* @template Source - The type against which the assertion is made.
|
|
237
|
-
*/
|
|
238
|
-
<Source>(): Modifier;
|
|
239
|
-
/**
|
|
240
|
-
* Marks an assertion as supposed to fail.
|
|
241
|
-
*
|
|
242
|
-
* @param source - The expression against which type the assertion is made.
|
|
243
|
-
*/
|
|
244
|
-
(source: unknown): Modifier;
|
|
245
|
-
};
|
|
246
204
|
};
|
|
247
205
|
}
|
|
248
206
|
/**
|
package/build/tstyche.d.ts
CHANGED
|
@@ -40,9 +40,10 @@ interface CommandLineOptions {
|
|
|
40
40
|
watch?: boolean;
|
|
41
41
|
}
|
|
42
42
|
interface ConfigFileOptions {
|
|
43
|
-
|
|
43
|
+
checkDeclarationFiles?: boolean;
|
|
44
44
|
checkSuppressedErrors?: boolean;
|
|
45
45
|
failFast?: boolean;
|
|
46
|
+
fixtureFileMatch?: Array<string>;
|
|
46
47
|
plugins?: Array<string>;
|
|
47
48
|
rejectAnyType?: boolean;
|
|
48
49
|
rejectNeverType?: boolean;
|
|
@@ -53,6 +54,7 @@ interface ConfigFileOptions {
|
|
|
53
54
|
tsconfig?: string;
|
|
54
55
|
}
|
|
55
56
|
interface InlineConfig {
|
|
57
|
+
fixme?: boolean;
|
|
56
58
|
if?: {
|
|
57
59
|
target?: Array<string>;
|
|
58
60
|
};
|
|
@@ -62,6 +64,17 @@ interface ResolvedConfig extends Omit<CommandLineOptions, "config" | keyof Confi
|
|
|
62
64
|
configFilePath: string;
|
|
63
65
|
pathMatch: Array<string>;
|
|
64
66
|
}
|
|
67
|
+
interface TextRange {
|
|
68
|
+
start: number;
|
|
69
|
+
end: number;
|
|
70
|
+
text: string;
|
|
71
|
+
}
|
|
72
|
+
interface DirectiveRange {
|
|
73
|
+
sourceFile: ts.SourceFile;
|
|
74
|
+
namespace: TextRange;
|
|
75
|
+
directive?: TextRange;
|
|
76
|
+
argument?: TextRange;
|
|
77
|
+
}
|
|
65
78
|
|
|
66
79
|
declare class Config {
|
|
67
80
|
#private;
|
|
@@ -84,9 +97,10 @@ declare class Config {
|
|
|
84
97
|
|
|
85
98
|
declare enum OptionBrand {
|
|
86
99
|
String = "string",
|
|
100
|
+
SemverRange = "range",
|
|
87
101
|
Number = "number",
|
|
88
102
|
Boolean = "boolean",
|
|
89
|
-
|
|
103
|
+
True = "true",
|
|
90
104
|
List = "list"
|
|
91
105
|
}
|
|
92
106
|
|
|
@@ -95,37 +109,25 @@ declare class ConfigDiagnosticText {
|
|
|
95
109
|
static expectsListItemType(optionName: string, optionBrand: OptionBrand): string;
|
|
96
110
|
static expectsValue(optionName: string): string;
|
|
97
111
|
static fileDoesNotExist(filePath: string): string;
|
|
112
|
+
static fileMatchPatternCannotStartWith(optionName: string, segment: string): Array<string>;
|
|
98
113
|
static inspectSupportedVersions(): string;
|
|
99
114
|
static moduleWasNotFound(specifier: string): string;
|
|
115
|
+
static optionValueMustBe(optionName: string, optionBrand: OptionBrand): string;
|
|
100
116
|
static rangeIsNotValid(value: string): string;
|
|
117
|
+
static rangeDoesNotMatchSupported(value: string): string;
|
|
101
118
|
static rangeUsage(): Array<string>;
|
|
102
|
-
static requiresValueType(optionName: string, optionBrand: OptionBrand): string;
|
|
103
119
|
static seen(element: string): string;
|
|
104
|
-
static testFileMatchCannotStartWith(segment: string): Array<string>;
|
|
105
120
|
static unexpected(element: string): string;
|
|
106
121
|
static unknownOption(optionName: string): string;
|
|
107
|
-
static usage(optionName: string, optionBrand: OptionBrand): Array<string>;
|
|
108
122
|
static versionIsNotSupported(value: string): string;
|
|
109
123
|
static watchCannotBeEnabled(): string;
|
|
110
124
|
}
|
|
111
125
|
|
|
112
|
-
interface TextRange {
|
|
113
|
-
start: number;
|
|
114
|
-
end: number;
|
|
115
|
-
text: string;
|
|
116
|
-
}
|
|
117
|
-
interface DirectiveRange {
|
|
118
|
-
namespace: TextRange;
|
|
119
|
-
directive?: TextRange;
|
|
120
|
-
argument?: TextRange;
|
|
121
|
-
}
|
|
122
|
-
type DirectiveRanges = Array<DirectiveRange> & {
|
|
123
|
-
sourceFile: ts.SourceFile;
|
|
124
|
-
};
|
|
125
126
|
declare class Directive {
|
|
126
127
|
#private;
|
|
127
|
-
static
|
|
128
|
-
static
|
|
128
|
+
static getDirectiveRange(compiler: typeof ts, owner: TestTreeNode, directiveText: string): DirectiveRange | undefined;
|
|
129
|
+
static getDirectiveRanges(compiler: typeof ts, node: ts.Node): Array<DirectiveRange> | undefined;
|
|
130
|
+
static getInlineConfig(ranges: Array<DirectiveRange> | DirectiveRange | undefined): Promise<InlineConfig | undefined>;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
declare const defaultOptions: Required<ConfigFileOptions>;
|
|
@@ -154,15 +156,21 @@ declare class SourceFile {
|
|
|
154
156
|
};
|
|
155
157
|
}
|
|
156
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
|
+
|
|
157
165
|
declare class DiagnosticOrigin {
|
|
158
|
-
|
|
166
|
+
assertionNode: ExpectNode | undefined;
|
|
159
167
|
end: number;
|
|
160
168
|
sourceFile: SourceFile | ts.SourceFile;
|
|
161
169
|
start: number;
|
|
162
|
-
constructor(start: number, end: number, sourceFile: SourceFile | ts.SourceFile,
|
|
163
|
-
static fromAssertion(
|
|
164
|
-
static fromNode(node: ts.Node,
|
|
165
|
-
static fromNodes(nodes: ts.NodeArray<ts.Node>,
|
|
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;
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
declare class Diagnostic {
|
|
@@ -178,7 +186,7 @@ declare class Diagnostic {
|
|
|
178
186
|
}): this;
|
|
179
187
|
static error(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
180
188
|
extendWith(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
181
|
-
static fromDiagnostics(diagnostics: Array<ts.Diagnostic
|
|
189
|
+
static fromDiagnostics(diagnostics: Array<ts.Diagnostic>): Array<Diagnostic>;
|
|
182
190
|
static warning(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
183
191
|
}
|
|
184
192
|
|
|
@@ -196,7 +204,7 @@ interface BaseOptionDefinition {
|
|
|
196
204
|
name: string;
|
|
197
205
|
}
|
|
198
206
|
interface PrimitiveTypeOptionDefinition extends BaseOptionDefinition {
|
|
199
|
-
brand: OptionBrand.String | OptionBrand.Number | OptionBrand.Boolean | OptionBrand.
|
|
207
|
+
brand: OptionBrand.String | OptionBrand.SemverRange | OptionBrand.Number | OptionBrand.Boolean | OptionBrand.True;
|
|
200
208
|
}
|
|
201
209
|
interface ItemDefinition {
|
|
202
210
|
brand: OptionBrand.String;
|
|
@@ -211,7 +219,16 @@ declare class Options {
|
|
|
211
219
|
#private;
|
|
212
220
|
static for(optionGroup: OptionGroup): Map<string, OptionDefinition>;
|
|
213
221
|
static resolve(optionName: string, optionValue: string, rootPath?: string): string;
|
|
214
|
-
static validate(optionName: string, optionValue: string,
|
|
222
|
+
static validate(optionName: string, optionValue: string, onDiagnostics: DiagnosticsHandler, origin?: DiagnosticOrigin): Promise<void>;
|
|
223
|
+
}
|
|
224
|
+
|
|
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;
|
|
215
232
|
}
|
|
216
233
|
|
|
217
234
|
declare enum TestTreeNodeBrand {
|
|
@@ -223,10 +240,9 @@ declare enum TestTreeNodeBrand {
|
|
|
223
240
|
|
|
224
241
|
declare enum TestTreeNodeFlags {
|
|
225
242
|
None = 0,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
Todo = 8
|
|
243
|
+
Only = 1,
|
|
244
|
+
Skip = 2,
|
|
245
|
+
Todo = 4
|
|
230
246
|
}
|
|
231
247
|
|
|
232
248
|
declare class WhenNode extends TestTreeNode {
|
|
@@ -239,14 +255,25 @@ declare class WhenNode extends TestTreeNode {
|
|
|
239
255
|
|
|
240
256
|
declare class TestTreeNode {
|
|
241
257
|
brand: TestTreeNodeBrand;
|
|
242
|
-
children: Array<TestTreeNode |
|
|
258
|
+
children: Array<TestTreeNode | ExpectNode | WhenNode>;
|
|
243
259
|
diagnostics: Set<ts.Diagnostic>;
|
|
244
260
|
flags: TestTreeNodeFlags;
|
|
245
261
|
name: string;
|
|
246
262
|
node: ts.CallExpression;
|
|
247
263
|
parent: TestTree | TestTreeNode;
|
|
248
264
|
constructor(compiler: typeof ts, brand: TestTreeNodeBrand, node: ts.CallExpression, parent: TestTree | TestTreeNode, flags: TestTreeNodeFlags);
|
|
249
|
-
|
|
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);
|
|
250
277
|
}
|
|
251
278
|
|
|
252
279
|
interface SuppressedError {
|
|
@@ -255,39 +282,14 @@ interface SuppressedError {
|
|
|
255
282
|
argument?: TextRange;
|
|
256
283
|
diagnostics: Array<ts.Diagnostic>;
|
|
257
284
|
}
|
|
258
|
-
type SuppressedErrors = Array<SuppressedError> & {
|
|
259
|
-
sourceFile: ts.SourceFile;
|
|
260
|
-
};
|
|
261
285
|
|
|
262
286
|
declare class TestTree {
|
|
263
|
-
children: Array<TestTreeNode |
|
|
287
|
+
children: Array<TestTreeNode | ExpectNode | WhenNode>;
|
|
264
288
|
diagnostics: Set<ts.Diagnostic>;
|
|
265
289
|
hasOnly: boolean;
|
|
266
290
|
sourceFile: ts.SourceFile;
|
|
267
|
-
suppressedErrors:
|
|
291
|
+
suppressedErrors: Array<SuppressedError> | undefined;
|
|
268
292
|
constructor(diagnostics: Set<ts.Diagnostic>, sourceFile: ts.SourceFile);
|
|
269
|
-
getDirectiveRanges(compiler: typeof ts): DirectiveRanges | undefined;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
declare class AssertionNode extends TestTreeNode {
|
|
273
|
-
abilityDiagnostics: Set<ts.Diagnostic>;
|
|
274
|
-
isNot: boolean;
|
|
275
|
-
matcherNode: ts.CallExpression | ts.Decorator;
|
|
276
|
-
matcherNameNode: ts.PropertyAccessExpression;
|
|
277
|
-
modifierNode: ts.PropertyAccessExpression;
|
|
278
|
-
notNode: ts.PropertyAccessExpression | undefined;
|
|
279
|
-
source: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode>;
|
|
280
|
-
target: ts.NodeArray<ts.Expression> | ts.NodeArray<ts.TypeNode> | undefined;
|
|
281
|
-
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);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
declare class ProjectService {
|
|
285
|
-
#private;
|
|
286
|
-
constructor(compiler: typeof ts, resolvedConfig: ResolvedConfig);
|
|
287
|
-
closeFile(filePath: string): void;
|
|
288
|
-
getDefaultProject(filePath: string): ts.server.Project | undefined;
|
|
289
|
-
getLanguageService(filePath: string): ts.LanguageService | undefined;
|
|
290
|
-
openFile(filePath: string, sourceText?: string | undefined, projectRootPath?: string | undefined): void;
|
|
291
293
|
}
|
|
292
294
|
|
|
293
295
|
declare class CollectService {
|
|
@@ -353,22 +355,24 @@ declare enum ResultStatus {
|
|
|
353
355
|
Passed = "passed",
|
|
354
356
|
Failed = "failed",
|
|
355
357
|
Skipped = "skipped",
|
|
358
|
+
Fixme = "fixme",
|
|
356
359
|
Todo = "todo"
|
|
357
360
|
}
|
|
358
361
|
|
|
359
362
|
declare class ExpectResult {
|
|
360
|
-
|
|
363
|
+
expect: ExpectNode;
|
|
361
364
|
diagnostics: Array<Diagnostic>;
|
|
362
365
|
parent: TestResult | undefined;
|
|
363
366
|
status: ResultStatus;
|
|
364
367
|
timing: ResultTiming;
|
|
365
|
-
constructor(
|
|
368
|
+
constructor(expect: ExpectNode, parent?: TestResult);
|
|
366
369
|
}
|
|
367
370
|
|
|
368
371
|
declare class ResultCount {
|
|
369
372
|
failed: number;
|
|
370
373
|
passed: number;
|
|
371
374
|
skipped: number;
|
|
375
|
+
fixme: number;
|
|
372
376
|
todo: number;
|
|
373
377
|
get total(): number;
|
|
374
378
|
}
|
|
@@ -392,52 +396,52 @@ declare class DescribeResult {
|
|
|
392
396
|
constructor(describe: TestTreeNode, parent?: DescribeResult);
|
|
393
397
|
}
|
|
394
398
|
|
|
395
|
-
declare class
|
|
399
|
+
declare class FileLocation {
|
|
396
400
|
#private;
|
|
397
|
-
|
|
401
|
+
path: string;
|
|
398
402
|
position: number | undefined;
|
|
399
|
-
constructor(
|
|
403
|
+
constructor(file: string | URL, position?: number);
|
|
400
404
|
}
|
|
401
405
|
|
|
402
|
-
type
|
|
403
|
-
declare class
|
|
406
|
+
type FileResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
407
|
+
declare class FileResult {
|
|
404
408
|
diagnostics: Array<Diagnostic>;
|
|
405
409
|
expectCount: ResultCount;
|
|
410
|
+
file: FileLocation;
|
|
406
411
|
results: Array<DescribeResult | TestResult | ExpectResult>;
|
|
407
|
-
status:
|
|
408
|
-
task: Task;
|
|
412
|
+
status: FileResultStatus;
|
|
409
413
|
testCount: ResultCount;
|
|
410
414
|
timing: ResultTiming;
|
|
411
|
-
constructor(
|
|
415
|
+
constructor(file: FileLocation);
|
|
412
416
|
}
|
|
413
417
|
|
|
414
418
|
declare class ProjectResult {
|
|
415
419
|
compilerVersion: string;
|
|
416
420
|
diagnostics: Array<Diagnostic>;
|
|
417
421
|
projectConfigFilePath: string | undefined;
|
|
418
|
-
results: Array<
|
|
422
|
+
results: Array<FileResult>;
|
|
419
423
|
constructor(compilerVersion: string, projectConfigFilePath: string | undefined);
|
|
420
424
|
}
|
|
421
425
|
|
|
422
426
|
type TargetResultStatus = ResultStatus.Runs | ResultStatus.Passed | ResultStatus.Failed;
|
|
423
427
|
declare class TargetResult {
|
|
428
|
+
files: Array<FileLocation>;
|
|
424
429
|
results: Map<string | undefined, ProjectResult>;
|
|
425
430
|
status: TargetResultStatus;
|
|
426
431
|
target: string;
|
|
427
|
-
tasks: Array<Task>;
|
|
428
432
|
timing: ResultTiming;
|
|
429
|
-
constructor(target: string,
|
|
433
|
+
constructor(target: string, files: Array<FileLocation>);
|
|
430
434
|
}
|
|
431
435
|
|
|
432
436
|
declare class Result {
|
|
433
437
|
expectCount: ResultCount;
|
|
434
438
|
fileCount: ResultCount;
|
|
439
|
+
files: Array<FileLocation>;
|
|
435
440
|
results: Array<TargetResult>;
|
|
436
441
|
targetCount: ResultCount;
|
|
437
|
-
tasks: Array<Task>;
|
|
438
442
|
testCount: ResultCount;
|
|
439
443
|
timing: ResultTiming;
|
|
440
|
-
constructor(
|
|
444
|
+
constructor(files: Array<FileLocation>);
|
|
441
445
|
}
|
|
442
446
|
|
|
443
447
|
interface EventHandler {
|
|
@@ -465,13 +469,13 @@ type Event = ["config:error", {
|
|
|
465
469
|
projectConfigFilePath: string | undefined;
|
|
466
470
|
}] | ["project:error", {
|
|
467
471
|
diagnostics: Array<Diagnostic>;
|
|
468
|
-
}] | ["
|
|
469
|
-
result:
|
|
470
|
-
}] | ["
|
|
472
|
+
}] | ["file:start", {
|
|
473
|
+
result: FileResult;
|
|
474
|
+
}] | ["file:error", {
|
|
471
475
|
diagnostics: Array<Diagnostic>;
|
|
472
|
-
result:
|
|
473
|
-
}] | ["
|
|
474
|
-
result:
|
|
476
|
+
result: FileResult;
|
|
477
|
+
}] | ["file:end", {
|
|
478
|
+
result: FileResult;
|
|
475
479
|
}] | ["directive:error", {
|
|
476
480
|
diagnostics: Array<Diagnostic>;
|
|
477
481
|
}] | ["collect:start", {
|
|
@@ -479,7 +483,7 @@ type Event = ["config:error", {
|
|
|
479
483
|
}] | ["collect:error", {
|
|
480
484
|
diagnostics: Array<Diagnostic>;
|
|
481
485
|
}] | ["collect:node", {
|
|
482
|
-
node: TestTreeNode |
|
|
486
|
+
node: TestTreeNode | ExpectNode | WhenNode;
|
|
483
487
|
}] | ["collect:end", {
|
|
484
488
|
tree: TestTree;
|
|
485
489
|
}] | ["describe:start", {
|
|
@@ -497,6 +501,8 @@ type Event = ["config:error", {
|
|
|
497
501
|
result: TestResult;
|
|
498
502
|
}] | ["test:skip", {
|
|
499
503
|
result: TestResult;
|
|
504
|
+
}] | ["test:fixme", {
|
|
505
|
+
result: TestResult;
|
|
500
506
|
}] | ["test:todo", {
|
|
501
507
|
result: TestResult;
|
|
502
508
|
}] | ["expect:start", {
|
|
@@ -511,6 +517,8 @@ type Event = ["config:error", {
|
|
|
511
517
|
result: ExpectResult;
|
|
512
518
|
}] | ["expect:skip", {
|
|
513
519
|
result: ExpectResult;
|
|
520
|
+
}] | ["expect:fixme", {
|
|
521
|
+
result: ExpectResult;
|
|
514
522
|
}] | ["watch:error", {
|
|
515
523
|
diagnostics: Array<Diagnostic>;
|
|
516
524
|
}];
|
|
@@ -555,7 +563,7 @@ declare class ExpectService {
|
|
|
555
563
|
private toHaveProperty;
|
|
556
564
|
private toRaiseError;
|
|
557
565
|
constructor(compiler: typeof ts, typeChecker: TypeChecker, reject: Reject);
|
|
558
|
-
match(
|
|
566
|
+
match(assertionNode: ExpectNode, onDiagnostics: DiagnosticsHandler<Diagnostic | Array<Diagnostic>>): MatchResult | undefined;
|
|
559
567
|
}
|
|
560
568
|
|
|
561
569
|
declare class Glob {
|
|
@@ -653,6 +661,8 @@ interface CodeFrameOptions {
|
|
|
653
661
|
|
|
654
662
|
declare function diagnosticText(diagnostic: Diagnostic, codeFrameOptions?: CodeFrameOptions): ScribblerJsx.Element;
|
|
655
663
|
|
|
664
|
+
declare function fileStatusText(status: FileResultStatus, file: FileLocation): ScribblerJsx.Element;
|
|
665
|
+
|
|
656
666
|
declare function fileViewText(lines: Array<ScribblerJsx.Element>, addEmptyFinalLine: boolean): ScribblerJsx.Element;
|
|
657
667
|
|
|
658
668
|
declare function formattedText(input: string | Array<string> | Record<string, unknown>): ScribblerJsx.Element;
|
|
@@ -676,9 +686,7 @@ declare function summaryText({ duration, expectCount, fileCount, targetCount, te
|
|
|
676
686
|
testCount: ResultCount;
|
|
677
687
|
}): ScribblerJsx.Element;
|
|
678
688
|
|
|
679
|
-
declare function
|
|
680
|
-
|
|
681
|
-
declare function testNameText(status: "fail" | "pass" | "skip" | "todo", name: string, indent?: number): ScribblerJsx.Element;
|
|
689
|
+
declare function testNameText(status: "fail" | "pass" | "skip" | "fixme" | "todo", name: string, indent?: number): ScribblerJsx.Element;
|
|
682
690
|
|
|
683
691
|
declare function usesCompilerText(compilerVersion: string, projectConfigFilePath: string | undefined, options?: {
|
|
684
692
|
prependEmptyLine: boolean;
|
|
@@ -717,11 +725,12 @@ declare class Runner {
|
|
|
717
725
|
#private;
|
|
718
726
|
static version: string;
|
|
719
727
|
constructor(resolvedConfig: ResolvedConfig);
|
|
720
|
-
run(
|
|
728
|
+
run(files: Array<string | URL | FileLocation>, cancellationToken?: CancellationToken): Promise<void>;
|
|
721
729
|
}
|
|
722
730
|
|
|
723
731
|
declare class Select {
|
|
724
732
|
#private;
|
|
733
|
+
static isFixtureFile(filePath: string, resolvedConfig: ResolvedConfig): boolean;
|
|
725
734
|
static isTestFile(filePath: string, resolvedConfig: ResolvedConfig): boolean;
|
|
726
735
|
static selectFiles(resolvedConfig: ResolvedConfig): Promise<Array<string>>;
|
|
727
736
|
}
|
|
@@ -777,7 +786,8 @@ declare class Store {
|
|
|
777
786
|
}
|
|
778
787
|
|
|
779
788
|
declare class SuppressedService {
|
|
780
|
-
|
|
789
|
+
#private;
|
|
790
|
+
match(testTree: TestTree, onDiagnostics: DiagnosticsHandler<Array<Diagnostic>>): void;
|
|
781
791
|
}
|
|
782
792
|
|
|
783
793
|
declare class Version {
|
|
@@ -805,8 +815,8 @@ declare class FileWatcher extends Watcher {
|
|
|
805
815
|
|
|
806
816
|
declare class WatchService {
|
|
807
817
|
#private;
|
|
808
|
-
constructor(resolvedConfig: ResolvedConfig,
|
|
809
|
-
watch(cancellationToken: CancellationToken): AsyncIterable<Array<
|
|
818
|
+
constructor(resolvedConfig: ResolvedConfig, files: Array<FileLocation>);
|
|
819
|
+
watch(cancellationToken: CancellationToken): AsyncIterable<Array<FileLocation>>;
|
|
810
820
|
}
|
|
811
821
|
|
|
812
822
|
declare class WhenService {
|
|
@@ -815,5 +825,5 @@ declare class WhenService {
|
|
|
815
825
|
action(when: WhenNode): void;
|
|
816
826
|
}
|
|
817
827
|
|
|
818
|
-
export {
|
|
819
|
-
export type { CodeFrameOptions, CommandLineOptions, ConfigFileOptions, DiagnosticsHandler, DirectiveRange,
|
|
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 };
|