tstyche 1.0.0 → 1.1.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 +6 -3
- package/build/index.d.cts +11 -11
- package/build/index.d.ts +11 -11
- package/build/tstyche.d.ts +16 -11
- package/build/tstyche.js +129 -129
- package/package.json +14 -18
- package/CHANGELOG.md +0 -156
package/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[![version][version-badge]][version-url]
|
|
4
4
|
[![license][license-badge]][license-url]
|
|
5
|
-
[![
|
|
5
|
+
[![requirements][requirements-badge]][requirements-url]
|
|
6
|
+
[![install-size][install-size-badge]][install-size-url]
|
|
6
7
|
[![coverage][coverage-badge]][coverage-url]
|
|
7
8
|
[![discord][discord-badge]][discord-url]
|
|
8
9
|
|
|
@@ -88,8 +89,10 @@ If you have any questions or suggestions, [start a discussion](https://github.co
|
|
|
88
89
|
[version-url]: https://npmjs.com/package/tstyche
|
|
89
90
|
[license-badge]: https://badgen.net/github/license/tstyche/tstyche
|
|
90
91
|
[license-url]: https://github.com/tstyche/tstyche/blob/main/LICENSE.md
|
|
91
|
-
[
|
|
92
|
-
[
|
|
92
|
+
[requirements-badge]: https://badgen.net/npm/node/tstyche
|
|
93
|
+
[requirements-url]: https://tstyche.org/reference/requirements
|
|
94
|
+
[install-size-badge]: https://badgen.net/install-size/install/tstyche
|
|
95
|
+
[install-size-url]: https://install-size.com/result?p=tstyche
|
|
93
96
|
[coverage-badge]: https://badgen.net/codacy/coverage/a581ca5c323a455886b7bdd9623c4ec8
|
|
94
97
|
[coverage-url]: https://app.codacy.com/gh/tstyche/tstyche/coverage/dashboard
|
|
95
98
|
[discord-badge]: https://badgen.net/static/chat/on%20Discord
|
package/build/index.d.cts
CHANGED
|
@@ -77,47 +77,47 @@ interface Matchers {
|
|
|
77
77
|
(target: unknown): void;
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
80
|
-
* Checks if the
|
|
80
|
+
* Checks if the source type is `bigint`.
|
|
81
81
|
*/
|
|
82
82
|
toBeBigInt: () => void;
|
|
83
83
|
/**
|
|
84
|
-
* Checks if the
|
|
84
|
+
* Checks if the source type is `boolean`.
|
|
85
85
|
*/
|
|
86
86
|
toBeBoolean: () => void;
|
|
87
87
|
/**
|
|
88
|
-
* Checks if the
|
|
88
|
+
* Checks if the source type is `never`.
|
|
89
89
|
*/
|
|
90
90
|
toBeNever: () => void;
|
|
91
91
|
/**
|
|
92
|
-
* Checks if the
|
|
92
|
+
* Checks if the source type is `null`.
|
|
93
93
|
*/
|
|
94
94
|
toBeNull: () => void;
|
|
95
95
|
/**
|
|
96
|
-
* Checks if the
|
|
96
|
+
* Checks if the source type is `number`.
|
|
97
97
|
*/
|
|
98
98
|
toBeNumber: () => void;
|
|
99
99
|
/**
|
|
100
|
-
* Checks if the
|
|
100
|
+
* Checks if the source type is `string`.
|
|
101
101
|
*/
|
|
102
102
|
toBeString: () => void;
|
|
103
103
|
/**
|
|
104
|
-
* Checks if the
|
|
104
|
+
* Checks if the source type is `symbol`.
|
|
105
105
|
*/
|
|
106
106
|
toBeSymbol: () => void;
|
|
107
107
|
/**
|
|
108
|
-
* Checks if the
|
|
108
|
+
* Checks if the source type is `undefined`.
|
|
109
109
|
*/
|
|
110
110
|
toBeUndefined: () => void;
|
|
111
111
|
/**
|
|
112
|
-
* Checks if the
|
|
112
|
+
* Checks if the source type is `unique symbol`.
|
|
113
113
|
*/
|
|
114
114
|
toBeUniqueSymbol: () => void;
|
|
115
115
|
/**
|
|
116
|
-
* Checks if the
|
|
116
|
+
* Checks if the source type is `unknown`.
|
|
117
117
|
*/
|
|
118
118
|
toBeUnknown: () => void;
|
|
119
119
|
/**
|
|
120
|
-
* Checks if the
|
|
120
|
+
* Checks if the source type is `void`.
|
|
121
121
|
*/
|
|
122
122
|
toBeVoid: () => void;
|
|
123
123
|
/**
|
package/build/index.d.ts
CHANGED
|
@@ -77,47 +77,47 @@ interface Matchers {
|
|
|
77
77
|
(target: unknown): void;
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
80
|
-
* Checks if the
|
|
80
|
+
* Checks if the source type is `bigint`.
|
|
81
81
|
*/
|
|
82
82
|
toBeBigInt: () => void;
|
|
83
83
|
/**
|
|
84
|
-
* Checks if the
|
|
84
|
+
* Checks if the source type is `boolean`.
|
|
85
85
|
*/
|
|
86
86
|
toBeBoolean: () => void;
|
|
87
87
|
/**
|
|
88
|
-
* Checks if the
|
|
88
|
+
* Checks if the source type is `never`.
|
|
89
89
|
*/
|
|
90
90
|
toBeNever: () => void;
|
|
91
91
|
/**
|
|
92
|
-
* Checks if the
|
|
92
|
+
* Checks if the source type is `null`.
|
|
93
93
|
*/
|
|
94
94
|
toBeNull: () => void;
|
|
95
95
|
/**
|
|
96
|
-
* Checks if the
|
|
96
|
+
* Checks if the source type is `number`.
|
|
97
97
|
*/
|
|
98
98
|
toBeNumber: () => void;
|
|
99
99
|
/**
|
|
100
|
-
* Checks if the
|
|
100
|
+
* Checks if the source type is `string`.
|
|
101
101
|
*/
|
|
102
102
|
toBeString: () => void;
|
|
103
103
|
/**
|
|
104
|
-
* Checks if the
|
|
104
|
+
* Checks if the source type is `symbol`.
|
|
105
105
|
*/
|
|
106
106
|
toBeSymbol: () => void;
|
|
107
107
|
/**
|
|
108
|
-
* Checks if the
|
|
108
|
+
* Checks if the source type is `undefined`.
|
|
109
109
|
*/
|
|
110
110
|
toBeUndefined: () => void;
|
|
111
111
|
/**
|
|
112
|
-
* Checks if the
|
|
112
|
+
* Checks if the source type is `unique symbol`.
|
|
113
113
|
*/
|
|
114
114
|
toBeUniqueSymbol: () => void;
|
|
115
115
|
/**
|
|
116
|
-
* Checks if the
|
|
116
|
+
* Checks if the source type is `unknown`.
|
|
117
117
|
*/
|
|
118
118
|
toBeUnknown: () => void;
|
|
119
119
|
/**
|
|
120
|
-
* Checks if the
|
|
120
|
+
* Checks if the source type is `void`.
|
|
121
121
|
*/
|
|
122
122
|
toBeVoid: () => void;
|
|
123
123
|
/**
|
package/build/tstyche.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ interface DiagnosticOrigin {
|
|
|
12
12
|
start: number;
|
|
13
13
|
}
|
|
14
14
|
declare class Diagnostic {
|
|
15
|
-
#private;
|
|
16
15
|
text: string | Array<string>;
|
|
17
16
|
category: DiagnosticCategory;
|
|
18
17
|
origin?: DiagnosticOrigin | undefined;
|
|
@@ -31,17 +30,23 @@ declare class Diagnostic {
|
|
|
31
30
|
static warning(text: string | Array<string>, origin?: DiagnosticOrigin): Diagnostic;
|
|
32
31
|
}
|
|
33
32
|
|
|
33
|
+
declare class CancellationToken {
|
|
34
|
+
#private;
|
|
35
|
+
get isCancellationRequested(): boolean;
|
|
36
|
+
cancel(): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
declare class StoreService {
|
|
35
40
|
#private;
|
|
36
41
|
constructor();
|
|
37
|
-
getSupportedTags(
|
|
38
|
-
install(tag: string,
|
|
39
|
-
load(tag: string,
|
|
40
|
-
open(
|
|
42
|
+
getSupportedTags(): Promise<Array<string>>;
|
|
43
|
+
install(tag: string, cancellationToken?: CancellationToken): Promise<string | undefined>;
|
|
44
|
+
load(tag: string, cancellationToken?: CancellationToken): Promise<typeof ts | undefined>;
|
|
45
|
+
open(): Promise<void>;
|
|
41
46
|
prune: () => Promise<void>;
|
|
42
|
-
resolveTag(tag: string
|
|
43
|
-
update(
|
|
44
|
-
validateTag(tag: string
|
|
47
|
+
resolveTag(tag: string): Promise<string | undefined>;
|
|
48
|
+
update(): Promise<void>;
|
|
49
|
+
validateTag(tag: string): Promise<boolean | undefined>;
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
declare enum OptionBrand {
|
|
@@ -178,7 +183,7 @@ declare class ConfigService {
|
|
|
178
183
|
declare class TSTyche {
|
|
179
184
|
#private;
|
|
180
185
|
readonly resolvedConfig: ResolvedConfig;
|
|
181
|
-
static readonly version = "1.
|
|
186
|
+
static readonly version = "1.1.0";
|
|
182
187
|
constructor(resolvedConfig: ResolvedConfig, storeService: StoreService);
|
|
183
188
|
run(testFiles: Array<string | URL>): Promise<void>;
|
|
184
189
|
}
|
|
@@ -640,7 +645,7 @@ declare class TaskRunner {
|
|
|
640
645
|
#private;
|
|
641
646
|
readonly resolvedConfig: ResolvedConfig;
|
|
642
647
|
constructor(resolvedConfig: ResolvedConfig, storeService: StoreService);
|
|
643
|
-
run(testFiles: Array<URL>, target: Array<string>,
|
|
648
|
+
run(testFiles: Array<URL>, target: Array<string>, cancellationToken?: CancellationToken): Promise<Result>;
|
|
644
649
|
}
|
|
645
650
|
|
|
646
651
|
declare enum Color {
|
|
@@ -749,4 +754,4 @@ declare class Version {
|
|
|
749
754
|
static isVersionTag(target: string): boolean;
|
|
750
755
|
}
|
|
751
756
|
|
|
752
|
-
export { Assertion, Cli, CollectService, Color, type CommandLineOptions, type ConfigFileOptions, ConfigService, DescribeResult, Diagnostic, DiagnosticCategory, type DiagnosticOrigin, Environment, type Event, EventEmitter, type EventHandler, Expect, ExpectResult, FileResult, type FileResultStatus, type ItemDefinition, Line, Logger, type LoggerOptions, type MatchResult, OptionBrand, type OptionDefinition, OptionDefinitionsMap, OptionGroup, Path, ProjectResult, ProjectService, Reporter, type ResolvedConfig, Result, ResultCount, ResultManager, ResultStatus, ResultTiming, Scribbler, type ScribblerOptions, StoreService, SummaryReporter, TSTyche, TargetResult, type TargetResultStatus, TaskRunner, TestMember, TestMemberBrand, TestMemberFlags, TestResult, TestTree, Text, ThoroughReporter, type TypeChecker, Version, type WriteStream, addsPackageStepText, describeNameText, diagnosticText, fileStatusText, fileViewText, formattedText, helpText, summaryText, testNameText, usesCompilerStepText };
|
|
757
|
+
export { Assertion, CancellationToken, Cli, CollectService, Color, type CommandLineOptions, type ConfigFileOptions, ConfigService, DescribeResult, Diagnostic, DiagnosticCategory, type DiagnosticOrigin, Environment, type Event, EventEmitter, type EventHandler, Expect, ExpectResult, FileResult, type FileResultStatus, type ItemDefinition, Line, Logger, type LoggerOptions, type MatchResult, OptionBrand, type OptionDefinition, OptionDefinitionsMap, OptionGroup, Path, ProjectResult, ProjectService, Reporter, type ResolvedConfig, Result, ResultCount, ResultManager, ResultStatus, ResultTiming, Scribbler, type ScribblerOptions, StoreService, SummaryReporter, TSTyche, TargetResult, type TargetResultStatus, TaskRunner, TestMember, TestMemberBrand, TestMemberFlags, TestResult, TestTree, Text, ThoroughReporter, type TypeChecker, Version, type WriteStream, addsPackageStepText, describeNameText, diagnosticText, fileStatusText, fileViewText, formattedText, helpText, summaryText, testNameText, usesCompilerStepText };
|
package/build/tstyche.js
CHANGED
|
@@ -35,7 +35,7 @@ class Path {
|
|
|
35
35
|
if (path.sep === "/") {
|
|
36
36
|
return filePath;
|
|
37
37
|
}
|
|
38
|
-
return filePath.
|
|
38
|
+
return filePath.replace(/\\/g, "/");
|
|
39
39
|
}
|
|
40
40
|
static relative(from, to) {
|
|
41
41
|
let relativePath = path.relative(from, to);
|
|
@@ -113,7 +113,7 @@ class Environment {
|
|
|
113
113
|
}
|
|
114
114
|
let resolvedPath;
|
|
115
115
|
try {
|
|
116
|
-
resolvedPath = createRequire(import.meta.url).resolve(moduleId);
|
|
116
|
+
resolvedPath = Path.normalizeSlashes(createRequire(import.meta.url).resolve(moduleId));
|
|
117
117
|
}
|
|
118
118
|
catch {
|
|
119
119
|
}
|
|
@@ -154,7 +154,7 @@ class Scribbler {
|
|
|
154
154
|
#indentEachLine(lines, level) {
|
|
155
155
|
const indentStep = " ";
|
|
156
156
|
const notEmptyLineRegExp = /^(?!$)/gm;
|
|
157
|
-
return lines.
|
|
157
|
+
return lines.replace(notEmptyLineRegExp, indentStep.repeat(level));
|
|
158
158
|
}
|
|
159
159
|
render(element) {
|
|
160
160
|
if (element != null) {
|
|
@@ -320,7 +320,7 @@ class CodeSpanText {
|
|
|
320
320
|
? this.props.file.text.length
|
|
321
321
|
: this.props.file.getPositionOfLineAndCharacter(index + 1, 0);
|
|
322
322
|
const lineNumberText = String(index + 1);
|
|
323
|
-
const lineText = this.props.file.text.slice(lineStart, lineEnd).trimEnd().
|
|
323
|
+
const lineText = this.props.file.text.slice(lineStart, lineEnd).trimEnd().replace(/\t/g, " ");
|
|
324
324
|
if (index === markedLine) {
|
|
325
325
|
codeSpan.push(Scribbler.createElement(Line, null,
|
|
326
326
|
Scribbler.createElement(Text, { color: "31" }, ">"),
|
|
@@ -1333,30 +1333,20 @@ class Diagnostic {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
static fromError(text, error) {
|
|
1335
1335
|
const messageText = Array.isArray(text) ? text : [text];
|
|
1336
|
-
if (error instanceof Error) {
|
|
1337
|
-
if (
|
|
1338
|
-
messageText.push(
|
|
1339
|
-
}
|
|
1340
|
-
messageText.push(this.#normalizeMessage(String(error.message)));
|
|
1341
|
-
if (error.stack != null) {
|
|
1342
|
-
const stackLines = error.stack
|
|
1343
|
-
.split("\n")
|
|
1344
|
-
.slice(1)
|
|
1345
|
-
.map((line) => line.trimStart());
|
|
1346
|
-
messageText.push(...stackLines);
|
|
1336
|
+
if (error instanceof Error && error.stack != null) {
|
|
1337
|
+
if (messageText.length > 1) {
|
|
1338
|
+
messageText.push("");
|
|
1347
1339
|
}
|
|
1340
|
+
const stackLines = error.stack
|
|
1341
|
+
.split("\n")
|
|
1342
|
+
.map((line) => line.trimStart());
|
|
1343
|
+
messageText.push(...stackLines);
|
|
1348
1344
|
}
|
|
1349
1345
|
return Diagnostic.error(messageText);
|
|
1350
1346
|
}
|
|
1351
1347
|
static isTsDiagnosticWithLocation(diagnostic) {
|
|
1352
1348
|
return diagnostic.file != null && diagnostic.start != null && diagnostic.length != null;
|
|
1353
1349
|
}
|
|
1354
|
-
static #normalizeMessage(text) {
|
|
1355
|
-
if (text.endsWith(".")) {
|
|
1356
|
-
return text;
|
|
1357
|
-
}
|
|
1358
|
-
return `${text}.`;
|
|
1359
|
-
}
|
|
1360
1350
|
static warning(text, origin) {
|
|
1361
1351
|
return new Diagnostic(text, "warning", origin);
|
|
1362
1352
|
}
|
|
@@ -2266,19 +2256,19 @@ class ProjectService {
|
|
|
2266
2256
|
class TestTreeWorker {
|
|
2267
2257
|
resolvedConfig;
|
|
2268
2258
|
compiler;
|
|
2259
|
+
#cancellationToken;
|
|
2269
2260
|
#expect;
|
|
2270
2261
|
#fileResult;
|
|
2271
2262
|
#hasOnly;
|
|
2272
2263
|
#position;
|
|
2273
|
-
#signal;
|
|
2274
2264
|
constructor(resolvedConfig, compiler, expect, options) {
|
|
2275
2265
|
this.resolvedConfig = resolvedConfig;
|
|
2276
2266
|
this.compiler = compiler;
|
|
2267
|
+
this.#cancellationToken = options.cancellationToken;
|
|
2277
2268
|
this.#expect = expect;
|
|
2278
2269
|
this.#fileResult = options.fileResult;
|
|
2279
2270
|
this.#hasOnly = options.hasOnly || resolvedConfig.only != null || options.position != null;
|
|
2280
2271
|
this.#position = options.position;
|
|
2281
|
-
this.#signal = options.signal;
|
|
2282
2272
|
}
|
|
2283
2273
|
#resolveRunMode(mode, member) {
|
|
2284
2274
|
if (member.flags & 1) {
|
|
@@ -2302,7 +2292,7 @@ class TestTreeWorker {
|
|
|
2302
2292
|
}
|
|
2303
2293
|
visit(members, runMode, parentResult) {
|
|
2304
2294
|
for (const member of members) {
|
|
2305
|
-
if (this.#
|
|
2295
|
+
if (this.#cancellationToken?.isCancellationRequested === true) {
|
|
2306
2296
|
break;
|
|
2307
2297
|
}
|
|
2308
2298
|
const validationError = member.validate();
|
|
@@ -2452,8 +2442,8 @@ class TestFileRunner {
|
|
|
2452
2442
|
this.#collectService = new CollectService(compiler);
|
|
2453
2443
|
this.#projectService = new ProjectService(compiler);
|
|
2454
2444
|
}
|
|
2455
|
-
run(testFile,
|
|
2456
|
-
if (
|
|
2445
|
+
run(testFile, cancellationToken) {
|
|
2446
|
+
if (cancellationToken?.isCancellationRequested === true) {
|
|
2457
2447
|
return;
|
|
2458
2448
|
}
|
|
2459
2449
|
const testFilePath = fileURLToPath(testFile);
|
|
@@ -2461,11 +2451,11 @@ class TestFileRunner {
|
|
|
2461
2451
|
this.#projectService.openFile(testFilePath, undefined, this.resolvedConfig.rootPath);
|
|
2462
2452
|
const fileResult = new FileResult(testFile);
|
|
2463
2453
|
EventEmitter.dispatch(["file:start", { result: fileResult }]);
|
|
2464
|
-
this.#runFile(testFilePath, fileResult, position,
|
|
2454
|
+
this.#runFile(testFilePath, fileResult, position, cancellationToken);
|
|
2465
2455
|
EventEmitter.dispatch(["file:end", { result: fileResult }]);
|
|
2466
2456
|
this.#projectService.closeFile(testFilePath);
|
|
2467
2457
|
}
|
|
2468
|
-
#runFile(testFilePath, fileResult, position,
|
|
2458
|
+
#runFile(testFilePath, fileResult, position, cancellationToken) {
|
|
2469
2459
|
const languageService = this.#projectService.getLanguageService(testFilePath);
|
|
2470
2460
|
if (!languageService) {
|
|
2471
2461
|
return;
|
|
@@ -2509,10 +2499,10 @@ class TestFileRunner {
|
|
|
2509
2499
|
}
|
|
2510
2500
|
const expect = new Expect(this.compiler, typeChecker);
|
|
2511
2501
|
const testTreeWorker = new TestTreeWorker(this.resolvedConfig, this.compiler, expect, {
|
|
2502
|
+
cancellationToken,
|
|
2512
2503
|
fileResult,
|
|
2513
2504
|
hasOnly: testTree.hasOnly,
|
|
2514
2505
|
position,
|
|
2515
|
-
signal,
|
|
2516
2506
|
});
|
|
2517
2507
|
testTreeWorker.visit(testTree.members, 0, undefined);
|
|
2518
2508
|
}
|
|
@@ -2530,17 +2520,17 @@ class TaskRunner {
|
|
|
2530
2520
|
this.#resultManager.handleEvent(event);
|
|
2531
2521
|
});
|
|
2532
2522
|
}
|
|
2533
|
-
async run(testFiles, target,
|
|
2523
|
+
async run(testFiles, target, cancellationToken) {
|
|
2534
2524
|
const result = new Result(this.resolvedConfig, testFiles);
|
|
2535
2525
|
EventEmitter.dispatch(["start", { result }]);
|
|
2536
2526
|
for (const versionTag of target) {
|
|
2537
2527
|
const targetResult = new TargetResult(versionTag, testFiles);
|
|
2538
2528
|
EventEmitter.dispatch(["target:start", { result: targetResult }]);
|
|
2539
|
-
const compiler = await this.#storeService.load(versionTag,
|
|
2529
|
+
const compiler = await this.#storeService.load(versionTag, cancellationToken);
|
|
2540
2530
|
if (compiler) {
|
|
2541
2531
|
const testFileRunner = new TestFileRunner(this.resolvedConfig, compiler);
|
|
2542
2532
|
for (const testFile of testFiles) {
|
|
2543
|
-
testFileRunner.run(testFile,
|
|
2533
|
+
testFileRunner.run(testFile, cancellationToken);
|
|
2544
2534
|
}
|
|
2545
2535
|
}
|
|
2546
2536
|
EventEmitter.dispatch(["target:end", { result: targetResult }]);
|
|
@@ -2550,12 +2540,24 @@ class TaskRunner {
|
|
|
2550
2540
|
}
|
|
2551
2541
|
}
|
|
2552
2542
|
|
|
2543
|
+
class CancellationToken {
|
|
2544
|
+
#isCancelled = false;
|
|
2545
|
+
get isCancellationRequested() {
|
|
2546
|
+
return this.#isCancelled;
|
|
2547
|
+
}
|
|
2548
|
+
cancel() {
|
|
2549
|
+
if (!this.#isCancelled) {
|
|
2550
|
+
this.#isCancelled = true;
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2553
2555
|
class TSTyche {
|
|
2554
2556
|
resolvedConfig;
|
|
2555
|
-
#
|
|
2557
|
+
#cancellationToken = new CancellationToken();
|
|
2556
2558
|
#storeService;
|
|
2557
2559
|
#taskRunner;
|
|
2558
|
-
static version = "1.
|
|
2560
|
+
static version = "1.1.0";
|
|
2559
2561
|
constructor(resolvedConfig, storeService) {
|
|
2560
2562
|
this.resolvedConfig = resolvedConfig;
|
|
2561
2563
|
this.#storeService = storeService;
|
|
@@ -2569,7 +2571,7 @@ class TSTyche {
|
|
|
2569
2571
|
&& payload.diagnostics.some((diagnostic) => diagnostic.category === "error")) {
|
|
2570
2572
|
process.exitCode = 1;
|
|
2571
2573
|
if (this.resolvedConfig.failFast) {
|
|
2572
|
-
this.#
|
|
2574
|
+
this.#cancellationToken.cancel();
|
|
2573
2575
|
}
|
|
2574
2576
|
}
|
|
2575
2577
|
}
|
|
@@ -2593,7 +2595,7 @@ class TSTyche {
|
|
|
2593
2595
|
});
|
|
2594
2596
|
}
|
|
2595
2597
|
async run(testFiles) {
|
|
2596
|
-
await this.#taskRunner.run(this.#normalizePaths(testFiles), this.resolvedConfig.target, this.#
|
|
2598
|
+
await this.#taskRunner.run(this.#normalizePaths(testFiles), this.resolvedConfig.target, this.#cancellationToken);
|
|
2597
2599
|
}
|
|
2598
2600
|
}
|
|
2599
2601
|
|
|
@@ -2800,7 +2802,7 @@ class OptionValidator {
|
|
|
2800
2802
|
}
|
|
2801
2803
|
break;
|
|
2802
2804
|
case "target":
|
|
2803
|
-
if (
|
|
2805
|
+
if (await this.#storeService.validateTag(optionValue) === false) {
|
|
2804
2806
|
this.#onDiagnostic(Diagnostic.error([
|
|
2805
2807
|
this.#optionDiagnosticText.versionIsNotSupported(optionValue),
|
|
2806
2808
|
...(await this.#optionUsageText.get(optionName, optionBrand)),
|
|
@@ -3190,42 +3192,40 @@ class ManifestWorker {
|
|
|
3190
3192
|
this.#manifestFilePath = Path.join(storePath, this.#manifestFileName);
|
|
3191
3193
|
this.#prune = prune;
|
|
3192
3194
|
}
|
|
3193
|
-
async #create(
|
|
3194
|
-
const manifest = await this.#load(
|
|
3195
|
+
async #create() {
|
|
3196
|
+
const manifest = await this.#load();
|
|
3195
3197
|
if (manifest != null) {
|
|
3196
3198
|
await this.persist(manifest);
|
|
3197
3199
|
}
|
|
3198
3200
|
return manifest;
|
|
3199
3201
|
}
|
|
3200
|
-
async #fetch(
|
|
3202
|
+
async #fetch() {
|
|
3201
3203
|
return new Promise((resolve, reject) => {
|
|
3202
3204
|
const request = https.get(new URL("typescript", this.#registryUrl), {
|
|
3203
3205
|
headers: { accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*" },
|
|
3204
|
-
|
|
3205
|
-
}, (
|
|
3206
|
-
if (
|
|
3207
|
-
reject(new Error(`Request failed with status code ${String(
|
|
3208
|
-
|
|
3206
|
+
timeout: this.#timeout,
|
|
3207
|
+
}, (response) => {
|
|
3208
|
+
if (response.statusCode !== 200) {
|
|
3209
|
+
reject(new Error(`Request failed with status code ${String(response.statusCode)}.`));
|
|
3210
|
+
response.resume();
|
|
3209
3211
|
return;
|
|
3210
3212
|
}
|
|
3211
|
-
|
|
3213
|
+
response.setEncoding("utf8");
|
|
3212
3214
|
let rawData = "";
|
|
3213
|
-
|
|
3215
|
+
response.on("data", (chunk) => {
|
|
3214
3216
|
rawData += chunk;
|
|
3215
3217
|
});
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
resolve(packageMetadata);
|
|
3220
|
-
}
|
|
3221
|
-
catch (error) {
|
|
3222
|
-
reject(error);
|
|
3223
|
-
}
|
|
3218
|
+
response.on("end", () => {
|
|
3219
|
+
const packageMetadata = JSON.parse(rawData);
|
|
3220
|
+
resolve(packageMetadata);
|
|
3224
3221
|
});
|
|
3225
3222
|
});
|
|
3226
3223
|
request.on("error", (error) => {
|
|
3227
3224
|
reject(error);
|
|
3228
3225
|
});
|
|
3226
|
+
request.on("timeout", () => {
|
|
3227
|
+
request.destroy();
|
|
3228
|
+
});
|
|
3229
3229
|
});
|
|
3230
3230
|
}
|
|
3231
3231
|
isOutdated(manifest, ageTolerance = 0) {
|
|
@@ -3234,7 +3234,7 @@ class ManifestWorker {
|
|
|
3234
3234
|
}
|
|
3235
3235
|
return false;
|
|
3236
3236
|
}
|
|
3237
|
-
async #load(
|
|
3237
|
+
async #load(options) {
|
|
3238
3238
|
const manifest = {
|
|
3239
3239
|
$version: this.#version,
|
|
3240
3240
|
lastUpdated: Date.now(),
|
|
@@ -3242,27 +3242,21 @@ class ManifestWorker {
|
|
|
3242
3242
|
versions: [],
|
|
3243
3243
|
};
|
|
3244
3244
|
let packageMetadata;
|
|
3245
|
-
const abortController = new AbortController();
|
|
3246
|
-
const timeoutSignal = AbortSignal.timeout(this.#timeout);
|
|
3247
|
-
timeoutSignal.addEventListener("abort", () => {
|
|
3248
|
-
abortController.abort(`Setup timeout of ${this.#timeout / 1000}s was exceeded.`);
|
|
3249
|
-
}, { once: true });
|
|
3250
|
-
signal?.addEventListener("abort", () => {
|
|
3251
|
-
abortController.abort("Fetch got canceled by request.");
|
|
3252
|
-
}, { once: true });
|
|
3253
3245
|
try {
|
|
3254
|
-
packageMetadata = await this.#fetch(
|
|
3246
|
+
packageMetadata = await this.#fetch();
|
|
3255
3247
|
}
|
|
3256
3248
|
catch (error) {
|
|
3257
|
-
if (
|
|
3258
|
-
|
|
3259
|
-
if (error instanceof Error && error.name !== "AbortError") {
|
|
3260
|
-
text.push("Might be there is an issue with the registry or the network connection.");
|
|
3261
|
-
}
|
|
3262
|
-
this.#onDiagnostic(Diagnostic.fromError(text, error));
|
|
3249
|
+
if (options?.quite === true) {
|
|
3250
|
+
return;
|
|
3263
3251
|
}
|
|
3264
|
-
|
|
3265
|
-
|
|
3252
|
+
const text = [`Failed to fetch metadata of the 'typescript' package from '${this.#registryUrl.toString()}'.`];
|
|
3253
|
+
if (error instanceof Error && "code" in error && error.code === "ECONNRESET") {
|
|
3254
|
+
text.push(`Setup timeout of ${this.#timeout / 1000}s was exceeded.`);
|
|
3255
|
+
}
|
|
3256
|
+
else {
|
|
3257
|
+
text.push("Might be there is an issue with the registry or the network connection.");
|
|
3258
|
+
}
|
|
3259
|
+
this.#onDiagnostic(Diagnostic.fromError(text, error));
|
|
3266
3260
|
return;
|
|
3267
3261
|
}
|
|
3268
3262
|
manifest.versions = Object.keys(packageMetadata.versions)
|
|
@@ -3283,10 +3277,10 @@ class ManifestWorker {
|
|
|
3283
3277
|
}
|
|
3284
3278
|
return manifest;
|
|
3285
3279
|
}
|
|
3286
|
-
async open(
|
|
3280
|
+
async open(options) {
|
|
3287
3281
|
let manifest;
|
|
3288
3282
|
if (!existsSync(this.#manifestFilePath)) {
|
|
3289
|
-
return this.#create(
|
|
3283
|
+
return this.#create();
|
|
3290
3284
|
}
|
|
3291
3285
|
let manifestText;
|
|
3292
3286
|
try {
|
|
@@ -3305,11 +3299,11 @@ class ManifestWorker {
|
|
|
3305
3299
|
}
|
|
3306
3300
|
if (manifest == null || manifest.$version !== this.#version) {
|
|
3307
3301
|
await this.#prune();
|
|
3308
|
-
return this.#create(
|
|
3302
|
+
return this.#create();
|
|
3309
3303
|
}
|
|
3310
3304
|
if (this.isOutdated(manifest) || options?.refresh === true) {
|
|
3311
3305
|
const quite = options?.refresh !== true;
|
|
3312
|
-
const freshManifest = await this.#load(
|
|
3306
|
+
const freshManifest = await this.#load({ quite });
|
|
3313
3307
|
if (freshManifest != null) {
|
|
3314
3308
|
await this.persist(freshManifest);
|
|
3315
3309
|
return freshManifest;
|
|
@@ -3348,7 +3342,7 @@ class Lock {
|
|
|
3348
3342
|
}
|
|
3349
3343
|
const waitStartTime = Date.now();
|
|
3350
3344
|
while (isLocked) {
|
|
3351
|
-
if (options.
|
|
3345
|
+
if (options.cancellationToken?.isCancellationRequested === true) {
|
|
3352
3346
|
break;
|
|
3353
3347
|
}
|
|
3354
3348
|
if (Date.now() - waitStartTime > options.timeout) {
|
|
@@ -3377,51 +3371,55 @@ class PackageInstaller {
|
|
|
3377
3371
|
this.#storePath = storePath;
|
|
3378
3372
|
this.#onDiagnostic = onDiagnostic;
|
|
3379
3373
|
}
|
|
3380
|
-
async ensure(compilerVersion,
|
|
3374
|
+
async ensure(compilerVersion, cancellationToken) {
|
|
3381
3375
|
const installationPath = Path.join(this.#storePath, compilerVersion);
|
|
3382
3376
|
const readyFilePath = Path.join(installationPath, this.#readyFileName);
|
|
3377
|
+
const modulePath = Path.join(installationPath, "node_modules", "typescript", "lib", "typescript.js");
|
|
3378
|
+
if (existsSync(readyFilePath)) {
|
|
3379
|
+
return modulePath;
|
|
3380
|
+
}
|
|
3383
3381
|
if (await Lock.isLocked(installationPath, {
|
|
3382
|
+
cancellationToken,
|
|
3384
3383
|
onDiagnostic: (text) => {
|
|
3385
3384
|
this.#onDiagnostic(Diagnostic.error([`Failed to install 'typescript@${compilerVersion}'.`, text]));
|
|
3386
3385
|
},
|
|
3387
|
-
signal,
|
|
3388
3386
|
timeout: this.#timeout,
|
|
3389
3387
|
})) {
|
|
3390
3388
|
return;
|
|
3391
3389
|
}
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
lock.release();
|
|
3411
|
-
}
|
|
3412
|
-
catch (error) {
|
|
3413
|
-
this.#onDiagnostic(Diagnostic.fromError(`Failed to install 'typescript@${compilerVersion}'.`, error));
|
|
3414
|
-
}
|
|
3390
|
+
const lock = new Lock(installationPath);
|
|
3391
|
+
EventEmitter.dispatch(["store:info", { compilerVersion, installationPath }]);
|
|
3392
|
+
try {
|
|
3393
|
+
await fs.mkdir(installationPath, { recursive: true });
|
|
3394
|
+
const packageJson = {
|
|
3395
|
+
name: "tstyche-typescript",
|
|
3396
|
+
version: compilerVersion,
|
|
3397
|
+
description: "Do not change. This package was generated by TSTyche",
|
|
3398
|
+
private: true,
|
|
3399
|
+
license: "MIT",
|
|
3400
|
+
dependencies: {
|
|
3401
|
+
typescript: compilerVersion,
|
|
3402
|
+
},
|
|
3403
|
+
};
|
|
3404
|
+
await fs.writeFile(Path.join(installationPath, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
3405
|
+
await this.#install(installationPath);
|
|
3406
|
+
await fs.writeFile(readyFilePath, "");
|
|
3407
|
+
return modulePath;
|
|
3415
3408
|
}
|
|
3416
|
-
|
|
3409
|
+
catch (error) {
|
|
3410
|
+
this.#onDiagnostic(Diagnostic.fromError(`Failed to install 'typescript@${compilerVersion}'.`, error));
|
|
3411
|
+
}
|
|
3412
|
+
finally {
|
|
3413
|
+
lock.release();
|
|
3414
|
+
}
|
|
3415
|
+
return;
|
|
3417
3416
|
}
|
|
3418
|
-
async #install(cwd
|
|
3417
|
+
async #install(cwd) {
|
|
3419
3418
|
const args = ["install", "--ignore-scripts", "--no-bin-links", "--no-package-lock"];
|
|
3420
3419
|
return new Promise((resolve, reject) => {
|
|
3421
3420
|
const spawnedNpm = spawn("npm", args, {
|
|
3422
3421
|
cwd,
|
|
3423
3422
|
shell: true,
|
|
3424
|
-
signal,
|
|
3425
3423
|
stdio: "ignore",
|
|
3426
3424
|
timeout: this.#timeout,
|
|
3427
3425
|
});
|
|
@@ -3433,9 +3431,9 @@ class PackageInstaller {
|
|
|
3433
3431
|
resolve();
|
|
3434
3432
|
}
|
|
3435
3433
|
if (signal != null) {
|
|
3436
|
-
reject(new Error(`
|
|
3434
|
+
reject(new Error(`setup timeout of ${this.#timeout / 1000}s was exceeded`));
|
|
3437
3435
|
}
|
|
3438
|
-
reject(new Error(`
|
|
3436
|
+
reject(new Error(`process exited with code ${String(code)}`));
|
|
3439
3437
|
});
|
|
3440
3438
|
});
|
|
3441
3439
|
}
|
|
@@ -3452,25 +3450,25 @@ class StoreService {
|
|
|
3452
3450
|
this.#packageInstaller = new PackageInstaller(this.#storePath, this.#onDiagnostic);
|
|
3453
3451
|
this.#manifestWorker = new ManifestWorker(this.#storePath, this.#onDiagnostic, this.prune);
|
|
3454
3452
|
}
|
|
3455
|
-
async getSupportedTags(
|
|
3456
|
-
await this.open(
|
|
3453
|
+
async getSupportedTags() {
|
|
3454
|
+
await this.open();
|
|
3457
3455
|
if (!this.#manifest) {
|
|
3458
3456
|
return [];
|
|
3459
3457
|
}
|
|
3460
3458
|
return [...Object.keys(this.#manifest.resolutions), ...this.#manifest.versions, "current"].sort();
|
|
3461
3459
|
}
|
|
3462
|
-
async install(tag,
|
|
3460
|
+
async install(tag, cancellationToken) {
|
|
3463
3461
|
if (tag === "current") {
|
|
3464
3462
|
return;
|
|
3465
3463
|
}
|
|
3466
|
-
const version = await this.resolveTag(tag
|
|
3464
|
+
const version = await this.resolveTag(tag);
|
|
3467
3465
|
if (version == null) {
|
|
3468
3466
|
this.#onDiagnostic(Diagnostic.error(`Cannot add the 'typescript' package for the '${tag}' tag.`));
|
|
3469
3467
|
return;
|
|
3470
3468
|
}
|
|
3471
|
-
return this.#packageInstaller.ensure(version,
|
|
3469
|
+
return this.#packageInstaller.ensure(version, cancellationToken);
|
|
3472
3470
|
}
|
|
3473
|
-
async load(tag,
|
|
3471
|
+
async load(tag, cancellationToken) {
|
|
3474
3472
|
let compilerInstance = this.#compilerInstanceCache.get(tag);
|
|
3475
3473
|
if (compilerInstance != null) {
|
|
3476
3474
|
return compilerInstance;
|
|
@@ -3480,7 +3478,7 @@ class StoreService {
|
|
|
3480
3478
|
modulePath = Environment.typescriptPath;
|
|
3481
3479
|
}
|
|
3482
3480
|
else {
|
|
3483
|
-
const version = await this.resolveTag(tag
|
|
3481
|
+
const version = await this.resolveTag(tag);
|
|
3484
3482
|
if (version == null) {
|
|
3485
3483
|
this.#onDiagnostic(Diagnostic.error(`Cannot add the 'typescript' package for the '${tag}' tag.`));
|
|
3486
3484
|
return;
|
|
@@ -3489,7 +3487,7 @@ class StoreService {
|
|
|
3489
3487
|
if (compilerInstance != null) {
|
|
3490
3488
|
return compilerInstance;
|
|
3491
3489
|
}
|
|
3492
|
-
modulePath = await this.#packageInstaller.ensure(version,
|
|
3490
|
+
modulePath = await this.#packageInstaller.ensure(version, cancellationToken);
|
|
3493
3491
|
}
|
|
3494
3492
|
if (modulePath != null) {
|
|
3495
3493
|
compilerInstance = await this.#loadModule(modulePath);
|
|
@@ -3521,20 +3519,20 @@ class StoreService {
|
|
|
3521
3519
|
#onDiagnostic = (diagnostic) => {
|
|
3522
3520
|
EventEmitter.dispatch(["store:error", { diagnostics: [diagnostic] }]);
|
|
3523
3521
|
};
|
|
3524
|
-
async open(
|
|
3522
|
+
async open() {
|
|
3525
3523
|
if (this.#manifest) {
|
|
3526
3524
|
return;
|
|
3527
3525
|
}
|
|
3528
|
-
this.#manifest = await this.#manifestWorker.open(
|
|
3526
|
+
this.#manifest = await this.#manifestWorker.open();
|
|
3529
3527
|
}
|
|
3530
3528
|
prune = async () => {
|
|
3531
3529
|
await fs.rm(this.#storePath, { force: true, recursive: true });
|
|
3532
3530
|
};
|
|
3533
|
-
async resolveTag(tag
|
|
3531
|
+
async resolveTag(tag) {
|
|
3534
3532
|
if (tag === "current") {
|
|
3535
3533
|
return tag;
|
|
3536
3534
|
}
|
|
3537
|
-
await this.open(
|
|
3535
|
+
await this.open();
|
|
3538
3536
|
if (!this.#manifest) {
|
|
3539
3537
|
return;
|
|
3540
3538
|
}
|
|
@@ -3543,16 +3541,16 @@ class StoreService {
|
|
|
3543
3541
|
}
|
|
3544
3542
|
return this.#manifest.resolutions[tag];
|
|
3545
3543
|
}
|
|
3546
|
-
async update(
|
|
3547
|
-
await this.#manifestWorker.open(
|
|
3544
|
+
async update() {
|
|
3545
|
+
await this.#manifestWorker.open({ refresh: true });
|
|
3548
3546
|
}
|
|
3549
|
-
async validateTag(tag
|
|
3547
|
+
async validateTag(tag) {
|
|
3550
3548
|
if (tag === "current") {
|
|
3551
3549
|
return Environment.typescriptPath != null;
|
|
3552
3550
|
}
|
|
3553
|
-
await this.open(
|
|
3551
|
+
await this.open();
|
|
3554
3552
|
if (!this.#manifest) {
|
|
3555
|
-
return
|
|
3553
|
+
return undefined;
|
|
3556
3554
|
}
|
|
3557
3555
|
if (this.#manifestWorker.isOutdated(this.#manifest, 60)
|
|
3558
3556
|
&& (!Version.isVersionTag(tag)
|
|
@@ -3568,6 +3566,7 @@ class StoreService {
|
|
|
3568
3566
|
}
|
|
3569
3567
|
|
|
3570
3568
|
class Cli {
|
|
3569
|
+
#cancellationToken = new CancellationToken();
|
|
3571
3570
|
#logger;
|
|
3572
3571
|
#storeService;
|
|
3573
3572
|
constructor() {
|
|
@@ -3584,8 +3583,9 @@ class Cli {
|
|
|
3584
3583
|
for (const diagnostic of payload.diagnostics) {
|
|
3585
3584
|
switch (diagnostic.category) {
|
|
3586
3585
|
case "error":
|
|
3587
|
-
|
|
3586
|
+
this.#cancellationToken.cancel();
|
|
3588
3587
|
this.#logger.writeError(diagnosticText(diagnostic));
|
|
3588
|
+
process.exitCode = 1;
|
|
3589
3589
|
break;
|
|
3590
3590
|
case "warning":
|
|
3591
3591
|
this.#logger.writeWarning(diagnosticText(diagnostic));
|
|
@@ -3620,11 +3620,11 @@ class Cli {
|
|
|
3620
3620
|
}
|
|
3621
3621
|
const configService = new ConfigService(compiler, this.#storeService);
|
|
3622
3622
|
await configService.parseCommandLine(commandLineArguments);
|
|
3623
|
-
if (
|
|
3623
|
+
if (this.#cancellationToken.isCancellationRequested) {
|
|
3624
3624
|
return;
|
|
3625
3625
|
}
|
|
3626
3626
|
await configService.readConfigFile();
|
|
3627
|
-
if (
|
|
3627
|
+
if (this.#cancellationToken.isCancellationRequested) {
|
|
3628
3628
|
return;
|
|
3629
3629
|
}
|
|
3630
3630
|
const resolvedConfig = configService.resolveConfig();
|
|
@@ -3662,4 +3662,4 @@ class Cli {
|
|
|
3662
3662
|
}
|
|
3663
3663
|
}
|
|
3664
3664
|
|
|
3665
|
-
export { Assertion, Cli, CollectService, Color, ConfigService, DescribeResult, Diagnostic, DiagnosticCategory, Environment, EventEmitter, Expect, ExpectResult, FileResult, Line, Logger, OptionBrand, OptionDefinitionsMap, OptionGroup, Path, ProjectResult, ProjectService, Reporter, Result, ResultCount, ResultManager, ResultStatus, ResultTiming, Scribbler, StoreService, SummaryReporter, TSTyche, TargetResult, TaskRunner, TestMember, TestMemberBrand, TestMemberFlags, TestResult, TestTree, Text, ThoroughReporter, Version, addsPackageStepText, describeNameText, diagnosticText, fileStatusText, fileViewText, formattedText, helpText, summaryText, testNameText, usesCompilerStepText };
|
|
3665
|
+
export { Assertion, CancellationToken, Cli, CollectService, Color, ConfigService, DescribeResult, Diagnostic, DiagnosticCategory, Environment, EventEmitter, Expect, ExpectResult, FileResult, Line, Logger, OptionBrand, OptionDefinitionsMap, OptionGroup, Path, ProjectResult, ProjectService, Reporter, Result, ResultCount, ResultManager, ResultStatus, ResultTiming, Scribbler, StoreService, SummaryReporter, TSTyche, TargetResult, TaskRunner, TestMember, TestMemberBrand, TestMemberFlags, TestResult, TestTree, Text, ThoroughReporter, Version, addsPackageStepText, describeNameText, diagnosticText, fileStatusText, fileViewText, formattedText, helpText, summaryText, testNameText, usesCompilerStepText };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tstyche",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "The Essential Type Testing Tool.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -50,36 +50,32 @@
|
|
|
50
50
|
"lint": "eslint ./ --config eslint.config.json --ext .js,.cts,.ts,.tsx",
|
|
51
51
|
"prepack": "yarn clean && yarn build",
|
|
52
52
|
"prepublish": "yarn test",
|
|
53
|
-
"test": "yarn test:unit && yarn test:e2e",
|
|
53
|
+
"test": "yarn test:unit && yarn test:schema && yarn test:e2e",
|
|
54
54
|
"test:coverage": "yarn build --sourcemap && c8 --config c8.config.json yarn test:e2e",
|
|
55
|
-
"test:e2e": "
|
|
55
|
+
"test:e2e": "mocha tests/*.js --config mocha.config.json",
|
|
56
56
|
"test:examples": "tstyche examples",
|
|
57
|
+
"test:schema": "mocha models/__tests__/*.js --config mocha.config.json",
|
|
57
58
|
"test:types": "tstyche tests",
|
|
58
|
-
"test:unit": "mocha --config mocha.config.json"
|
|
59
|
+
"test:unit": "mocha source/*/__tests__/*.js --config mocha.config.json"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"@jest/globals": "29.7.0",
|
|
62
62
|
"@rollup/plugin-typescript": "11.1.6",
|
|
63
|
-
"@types/chai": "4.3.11",
|
|
64
63
|
"@types/mocha": "10.0.6",
|
|
65
|
-
"@types/node": "20.11.
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "7.0
|
|
67
|
-
"@typescript-eslint/parser": "7.0
|
|
64
|
+
"@types/node": "20.11.20",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "7.1.0",
|
|
66
|
+
"@typescript-eslint/parser": "7.1.0",
|
|
68
67
|
"ajv": "8.12.0",
|
|
69
68
|
"c8": "9.1.0",
|
|
70
|
-
"
|
|
71
|
-
"cspell": "8.4.0",
|
|
69
|
+
"cspell": "8.4.1",
|
|
72
70
|
"dprint": "0.45.0",
|
|
73
|
-
"eslint": "8.
|
|
71
|
+
"eslint": "8.57.0",
|
|
74
72
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
75
73
|
"eslint-plugin-import": "2.29.1",
|
|
76
|
-
"eslint-plugin-
|
|
77
|
-
"eslint-plugin-jest-formatting": "3.1.0",
|
|
74
|
+
"eslint-plugin-mocha": "10.3.0",
|
|
78
75
|
"eslint-plugin-simple-import-sort": "12.0.0",
|
|
79
|
-
"jest": "29.7.0",
|
|
80
76
|
"magic-string": "0.30.7",
|
|
81
77
|
"mocha": "10.3.0",
|
|
82
|
-
"pretty-ansi": "
|
|
78
|
+
"pretty-ansi": "2.0.0",
|
|
83
79
|
"rollup": "4.12.0",
|
|
84
80
|
"rollup-plugin-dts": "6.1.0",
|
|
85
81
|
"tslib": "2.6.2",
|
|
@@ -95,6 +91,6 @@
|
|
|
95
91
|
},
|
|
96
92
|
"packageManager": "yarn@3.8.0",
|
|
97
93
|
"engines": {
|
|
98
|
-
"node": "
|
|
94
|
+
"node": ">=14.17"
|
|
99
95
|
}
|
|
100
|
-
}
|
|
96
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [1.0.0] - 2024-02-20
|
|
4
|
-
|
|
5
|
-
_Stable release based on [1.0.0-rc.2]._
|
|
6
|
-
|
|
7
|
-
## [1.0.0-rc.2] - 2024-02-14
|
|
8
|
-
|
|
9
|
-
### Fixed
|
|
10
|
-
|
|
11
|
-
- Use the `isTypeRelatedTo()` method directly, to make strict subtype checks possible ([#127](https://github.com/tstyche/tstyche/pull/127), [#126](https://github.com/tstyche/tstyche/pull/126))
|
|
12
|
-
|
|
13
|
-
## [1.0.0-rc.1] - 2024-02-10
|
|
14
|
-
|
|
15
|
-
### Changed
|
|
16
|
-
|
|
17
|
-
- **Breaking!** Remove the `disableTestFileLookup` option in favor of `testFileMatch: []` ([#121](https://github.com/tstyche/tstyche/pull/121))
|
|
18
|
-
|
|
19
|
-
### Added
|
|
20
|
-
|
|
21
|
-
- **New!** Set `module: "preserve"` in the default compiler options for inferred project that are using TypeScript 5.4 and up ([#111](https://github.com/tstyche/tstyche/pull/111))
|
|
22
|
-
|
|
23
|
-
### Fixed
|
|
24
|
-
|
|
25
|
-
- Do not select test files, if `testFileMatch` is an empty list ([#120](https://github.com/tstyche/tstyche/pull/120))
|
|
26
|
-
|
|
27
|
-
## [1.0.0-rc] - 2024-01-28
|
|
28
|
-
|
|
29
|
-
### Changed
|
|
30
|
-
|
|
31
|
-
- **Breaking!** Replace the `allowNoTestFiles` option with `disableTestFileLookup` ([#104](https://github.com/tstyche/tstyche/pull/104))
|
|
32
|
-
|
|
33
|
-
### Added
|
|
34
|
-
|
|
35
|
-
- **New!** Set default compiler options for inferred (e.g. JavaScript) projects ([#93](https://github.com/tstyche/tstyche/pull/93))
|
|
36
|
-
- Add the `TSTYCHE_NO_INTERACTIVE` environment variable ([#88](https://github.com/tstyche/tstyche/pull/88))
|
|
37
|
-
- Add the `TSTYCHE_TYPESCRIPT_PATH` environment variable ([#84](https://github.com/tstyche/tstyche/pull/84))
|
|
38
|
-
|
|
39
|
-
### Fixed
|
|
40
|
-
|
|
41
|
-
- Only select TypeScript and JavaScript files for test run ([#105](https://github.com/tstyche/tstyche/pull/105))
|
|
42
|
-
|
|
43
|
-
## [1.0.0-beta.9] - 2024-01-05
|
|
44
|
-
|
|
45
|
-
### Fixed
|
|
46
|
-
|
|
47
|
-
- Fix `"target": ["current"]` support for TypeScript 5.2 and below ([#83](https://github.com/tstyche/tstyche/pull/83))
|
|
48
|
-
|
|
49
|
-
## [1.0.0-beta.8] - 2024-01-05
|
|
50
|
-
|
|
51
|
-
### Changed
|
|
52
|
-
|
|
53
|
-
- **Breaking!** Make `"target": ["current"]` the default instead of `"target": ["latest"]` ([#81](https://github.com/tstyche/tstyche/pull/81), [#80](https://github.com/tstyche/tstyche/pull/80), [#66](https://github.com/tstyche/tstyche/pull/66))
|
|
54
|
-
- **New!** Load the installed TypeScript package for type testing instead of installing another copy to the store ([#71](https://github.com/tstyche/tstyche/pull/71), [#64](https://github.com/tstyche/tstyche/pull/64))
|
|
55
|
-
|
|
56
|
-
### Added
|
|
57
|
-
|
|
58
|
-
- Add the `Path` class ([#59](https://github.com/tstyche/tstyche/pull/59))
|
|
59
|
-
|
|
60
|
-
### Fixed
|
|
61
|
-
|
|
62
|
-
- Correctly handle command line options that do not take a value ([#58](https://github.com/tstyche/tstyche/pull/58))
|
|
63
|
-
|
|
64
|
-
## [1.0.0-beta.7] - 2023-12-29
|
|
65
|
-
|
|
66
|
-
### Changed
|
|
67
|
-
|
|
68
|
-
- **Breaking!** Add new `Expect` class to validate provided values and orchestrate matchers logic ([#39](https://github.com/tstyche/tstyche/pull/39))
|
|
69
|
-
|
|
70
|
-
### Added
|
|
71
|
-
|
|
72
|
-
- **New!** Load local language service plugins to support files like `.svelte` or `.vue` ([#56](https://github.com/tstyche/tstyche/pull/56))
|
|
73
|
-
|
|
74
|
-
### Fixed
|
|
75
|
-
|
|
76
|
-
- Make the source argument checks stricter for the `.toHaveProperty()` matcher ([#46](https://github.com/tstyche/tstyche/pull/46))
|
|
77
|
-
|
|
78
|
-
## [1.0.0-beta.6] - 2023-12-03
|
|
79
|
-
|
|
80
|
-
### Added
|
|
81
|
-
|
|
82
|
-
- **New!** Add `.toHaveProperty()` matcher ([#36](https://github.com/tstyche/tstyche/pull/36))
|
|
83
|
-
|
|
84
|
-
### Fixed
|
|
85
|
-
|
|
86
|
-
- Accept template literals as arguments of the `.toRaiseError()` matcher ([#38](https://github.com/tstyche/tstyche/pull/38))
|
|
87
|
-
|
|
88
|
-
## [1.0.0-beta.5] - 2023-11-27
|
|
89
|
-
|
|
90
|
-
### Changed
|
|
91
|
-
|
|
92
|
-
- **Breaking!** Move retry logic to the `Lock` class ([#31](https://github.com/tstyche/tstyche/pull/31))
|
|
93
|
-
- Bring back support for Node.js 16 ([#28](https://github.com/tstyche/tstyche/pull/28), [#27](https://github.com/tstyche/tstyche/pull/27))
|
|
94
|
-
|
|
95
|
-
### Added
|
|
96
|
-
|
|
97
|
-
- **New!** Add support for the `current` target tag ([#33](https://github.com/tstyche/tstyche/pull/33))
|
|
98
|
-
|
|
99
|
-
### Fixed
|
|
100
|
-
|
|
101
|
-
- Allow `.raiseError()` to take template literals as arguments ([#35](https://github.com/tstyche/tstyche/pull/35))
|
|
102
|
-
|
|
103
|
-
## [1.0.0-beta.4] - 2023-11-24
|
|
104
|
-
|
|
105
|
-
### Added
|
|
106
|
-
|
|
107
|
-
- Use Node.js Fetch API ([#23](https://github.com/tstyche/tstyche/pull/23))
|
|
108
|
-
|
|
109
|
-
### Removed
|
|
110
|
-
|
|
111
|
-
- **Breaking!** Remove the `context()` helper ([#24](https://github.com/tstyche/tstyche/pull/24))
|
|
112
|
-
- **Breaking!** Drop support for Node.js 16 ([#22](https://github.com/tstyche/tstyche/pull/22))
|
|
113
|
-
- **Breaking!** Rename methods of the `StoreService` class ([`5d74201`](https://github.com/tstyche/tstyche/commit/5d74201))
|
|
114
|
-
|
|
115
|
-
### Fixed
|
|
116
|
-
|
|
117
|
-
- Tune up behavior of `.skip` and `.only` run mode flags ([#25](https://github.com/tstyche/tstyche/pull/25))
|
|
118
|
-
- Clean up error messages of primitive type matchers ([#21](https://github.com/tstyche/tstyche/pull/21))
|
|
119
|
-
- Normalize `installationPath` path output ([#19](https://github.com/tstyche/tstyche/pull/19))
|
|
120
|
-
|
|
121
|
-
## [1.0.0-beta.3] - 2023-11-13
|
|
122
|
-
|
|
123
|
-
### Fixed
|
|
124
|
-
|
|
125
|
-
- Support TypeScript's 'node10' and 'node16' resolutions ([`7dd805a`](https://github.com/tstyche/tstyche/commit/7dd805a), [`9c83e79`](https://github.com/tstyche/tstyche/commit/9c83e79))
|
|
126
|
-
|
|
127
|
-
## [1.0.0-beta.2] - 2023-11-12
|
|
128
|
-
|
|
129
|
-
### Fixed
|
|
130
|
-
|
|
131
|
-
- Support TypeScript's 'node10' resolution ([#7](https://github.com/tstyche/tstyche/pull/7))
|
|
132
|
-
|
|
133
|
-
## [1.0.0-beta.1] - 2023-11-09
|
|
134
|
-
|
|
135
|
-
### Fixed
|
|
136
|
-
|
|
137
|
-
- Include 'cjs' files in the published package ([`90b6473`](https://github.com/tstyche/tstyche/commit/90b6473))
|
|
138
|
-
|
|
139
|
-
## [1.0.0-beta.0] - 2023-11-09
|
|
140
|
-
|
|
141
|
-
_First pre-release._
|
|
142
|
-
|
|
143
|
-
[1.0.0]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0
|
|
144
|
-
[1.0.0-rc.2]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-rc.2
|
|
145
|
-
[1.0.0-rc.1]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-rc.1
|
|
146
|
-
[1.0.0-rc]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-rc
|
|
147
|
-
[1.0.0-beta.9]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.9
|
|
148
|
-
[1.0.0-beta.8]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.8
|
|
149
|
-
[1.0.0-beta.7]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.7
|
|
150
|
-
[1.0.0-beta.6]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.6
|
|
151
|
-
[1.0.0-beta.5]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.5
|
|
152
|
-
[1.0.0-beta.4]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.4
|
|
153
|
-
[1.0.0-beta.3]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.3
|
|
154
|
-
[1.0.0-beta.2]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.2
|
|
155
|
-
[1.0.0-beta.1]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.1
|
|
156
|
-
[1.0.0-beta.0]: https://github.com/tstyche/tstyche/releases/tag/v1.0.0-beta.0
|