Skip to content

Commit 0fe9e34

Browse files
committed
Increase timeout of initial (dry) test suite run try complete call
1 parent f67e24b commit 0fe9e34

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

packages/@cli/src/CLITest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class CLITest extends Test<IOutput> {
4545
protected evalActualExpression(binary: string, args?: string[]): Promise<IOutput>;
4646
protected evalActualExpression(binaryOrArgs: string | string[], args: string[] = []): Promise<IOutput> {
4747
// TODO: Unix pipes abstraction (?)
48+
// TODO: Partial output match option (?)
4849
// TODO: Possibility top check underlying effect (and chain with other test suite) (?)
4950

5051
const effectiveBinary: string =

packages/testing/src/Test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export abstract class Test<T = unknown> {
3232
public wasSuccessful: boolean;
3333
public difference: IDifference<T>;
3434

35-
public static tryComplete() {
35+
public static tryComplete(timeout: number = _config.completeTimeout) {
3636
if (--Test.runningTests > 0) return;
3737

38-
Test.completeTimeout = setTimeout(() => Test.event.emit("complete"), _config.completeTimeout);
38+
Test.completeTimeout = setTimeout(() => Test.event.emit("complete"), timeout);
3939
}
4040

4141
constructor(title: string) {

packages/testing/src/api.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { Env } from "./Env";
77

88
import { FormatError } from "./FormatError";
99

10+
import _config from "./config.json";
11+
1012
interface IRecord {
1113
[key: string]: Test[];
1214
}
@@ -154,8 +156,8 @@ export async function init(apiArg: unknown, testTargetPath: string /* , options?
154156
curTestRecord[activeFilepath] = [curTestRecord[activeFilepath] ?? [], test].flat();
155157
});
156158

157-
Test.tryComplete();
158-
159159
traversePath(resolvedTestTargetPath);
160+
161+
Test.tryComplete(_config.dryCompleteTimeout);
160162
});
161163
}

packages/testing/src/config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2+
"completeTimeout": 250,
3+
"dryCompleteTimeout": 3000,
24
"envModuleFilename": "__test.env",
3-
"promisificationTimeout": 5000,
4-
"completeTimeout": 250
5+
"promisificationTimeout": 5000
56
}

0 commit comments

Comments
 (0)