@c9up/helix 0.2.2 → 0.2.4
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 +25 -111
- package/bin/helix.js +24 -41
- package/dist/cli/failed-cache.d.ts +2 -2
- package/dist/cli/failed-cache.js +2 -2
- package/dist/cli/native.d.ts +14 -31
- package/dist/cli/native.d.ts.map +1 -1
- package/dist/cli/native.js.map +1 -1
- package/dist/cli/pool.d.ts +3 -3
- package/dist/cli/reporter.d.ts +1 -1
- package/dist/cli/reporter.js +2 -2
- package/dist/cli/run.d.ts +5 -5
- package/dist/cli/run.js +4 -4
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/runner.d.ts +2 -1
- package/dist/cli/runner.d.ts.map +1 -1
- package/dist/cli/runner.js +2 -1
- package/dist/cli/runner.js.map +1 -1
- package/dist/cli/suites.d.ts +4 -4
- package/dist/cli/suites.d.ts.map +1 -1
- package/dist/cli/suites.js +36 -5
- package/dist/cli/suites.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/native/generated.d.ts +47 -0
- package/dist/native/generated.d.ts.map +1 -0
- package/dist/native/generated.js +7 -0
- package/dist/native/generated.js.map +1 -0
- package/dist/runtime/assert.d.ts +18 -18
- package/dist/runtime/assert.d.ts.map +1 -1
- package/dist/runtime/assert.js +3 -3
- package/dist/runtime/assert.js.map +1 -1
- package/dist/runtime/bootstrap.d.ts +2 -2
- package/dist/runtime/bootstrap.js +3 -3
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/cli-args.d.ts +6 -6
- package/dist/runtime/cli-args.d.ts.map +1 -1
- package/dist/runtime/cli-args.js +5 -5
- package/dist/runtime/cli-args.js.map +1 -1
- package/dist/runtime/configure.d.ts +43 -43
- package/dist/runtime/configure.d.ts.map +1 -1
- package/dist/runtime/configure.js +11 -11
- package/dist/runtime/configure.js.map +1 -1
- package/dist/runtime/context.d.ts +9 -9
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js +10 -10
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/drain-guard.d.ts +30 -0
- package/dist/runtime/drain-guard.d.ts.map +1 -0
- package/dist/runtime/drain-guard.js +56 -0
- package/dist/runtime/drain-guard.js.map +1 -0
- package/dist/runtime/emitter.d.ts +13 -13
- package/dist/runtime/emitter.d.ts.map +1 -1
- package/dist/runtime/emitter.js +6 -6
- package/dist/runtime/global-hooks.d.ts +1 -1
- package/dist/runtime/global-hooks.js +1 -1
- package/dist/runtime/run.d.ts +13 -13
- package/dist/runtime/run.d.ts.map +1 -1
- package/dist/runtime/run.js +47 -47
- package/dist/runtime/run.js.map +1 -1
- package/dist/runtime/runner.d.ts +12 -12
- package/dist/runtime/runner.d.ts.map +1 -1
- package/dist/runtime/runner.js +10 -10
- package/dist/runtime/runner.js.map +1 -1
- package/dist/runtime/suite-config.d.ts +1 -1
- package/dist/runtime/suite-config.js +1 -1
- package/dist/runtime/suite-taps.d.ts +17 -17
- package/dist/runtime/suite-taps.d.ts.map +1 -1
- package/dist/runtime/suite-taps.js +7 -7
- package/dist/runtime/suite-taps.js.map +1 -1
- package/dist/runtime/suite.d.ts +43 -43
- package/dist/runtime/suite.d.ts.map +1 -1
- package/dist/runtime/suite.js +14 -14
- package/dist/runtime/suite.js.map +1 -1
- package/dist/runtime/test-context.d.ts +8 -8
- package/dist/runtime/test-context.d.ts.map +1 -1
- package/dist/runtime/test-context.js +5 -5
- package/dist/runtime/test-context.js.map +1 -1
- package/dist/runtime/worker.js +4 -4
- package/dist/runtime/worker.js.map +1 -1
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../src/runtime/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAgB,OAAO,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAA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6EAA6E;IAC7E,oEAAoE;IACpE,KAAK,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC;YACJ,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,GAAG,CAAC,CAAC;QACtD,CAAC;IACF,CAAC;IACD,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1B,KAAK,IAAI,CAAC,GAAG,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACzD,IAAI,CAAC;YACJ,MAAM,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,GAAG,CAAC,CAAC;QACvD,CAAC;IACF,CAAC;IACD,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Injected test context —
|
|
2
|
+
* Injected test context — helix's defining mechanism.
|
|
3
3
|
*
|
|
4
4
|
* Every test body (and, later, group hooks) receives a `TestContext` as its
|
|
5
5
|
* FIRST argument: `test("x", ({ assert, client, db, cleanup }) => …)`. The
|
|
@@ -31,32 +31,32 @@ import { type TestCleanup } from "./test-context.js";
|
|
|
31
31
|
* declaration merging — `declare module "@c9up/helix" { interface TestContext {
|
|
32
32
|
* client: ApiClient } }` — without breaking the core's construction (an external
|
|
33
33
|
* augmentation is not subject to helix's `strictPropertyInitialization`). This
|
|
34
|
-
* is exactly how
|
|
34
|
+
* is exactly how helix's `TestContext` works.
|
|
35
35
|
*/
|
|
36
36
|
export declare class TestContext {
|
|
37
37
|
/**
|
|
38
|
-
* Add a shared property to every test context —
|
|
39
|
-
* `TestContext.macro('sleep', fn)`, callable on the class itself so a
|
|
38
|
+
* Add a shared property to every test context — helix's
|
|
39
|
+
* `TestContext.macro('sleep', fn)`, callable on the class itself so a helix
|
|
40
40
|
* plugin's registration code ports over unchanged.
|
|
41
41
|
*/
|
|
42
42
|
static macro(name: string, value: unknown): void;
|
|
43
|
-
/** Add a lazily-computed, per-context property (
|
|
43
|
+
/** Add a lazily-computed, per-context property (`TestContext.getter`). */
|
|
44
44
|
static getter(name: string, fn: Getter): void;
|
|
45
|
-
/** Chai-flavored assertions (
|
|
45
|
+
/** Chai-flavored assertions (`helix's assert` parity), alongside `expect`. */
|
|
46
46
|
readonly assert: Assert;
|
|
47
|
-
/** The running test's own instance — name, options, dataset (
|
|
47
|
+
/** The running test's own instance — name, options, dataset (`ctx.test`). */
|
|
48
48
|
readonly test: TestInstance;
|
|
49
49
|
constructor(test: TestInstance);
|
|
50
50
|
/**
|
|
51
51
|
* Register a teardown that runs at the end of THIS test, regardless of
|
|
52
|
-
* outcome (
|
|
52
|
+
* outcome (`ctx.cleanup`). Reverse-insertion order, isolated failures.
|
|
53
53
|
*/
|
|
54
54
|
cleanup(fn: TestCleanup): void;
|
|
55
55
|
}
|
|
56
56
|
export type Getter = (this: TestContext, ctx: TestContext) => unknown;
|
|
57
57
|
/**
|
|
58
58
|
* Registry through which plugins extend the test context at runtime. Mirrors
|
|
59
|
-
*
|
|
59
|
+
* helix's `TestContext.macro(name, value)` / `TestContext.getter(name, fn)`.
|
|
60
60
|
* Pair each call with a `declare module` augmentation for the types.
|
|
61
61
|
*/
|
|
62
62
|
export declare const TestContextRegistry: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/runtime/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmB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AC/C,MAAM,SAAS,OAAO,GAAG,IAAI;IAGzC;;;;OAIG;iBACU,MAAM,MAAM,MAAM,GAAG,IAAI;IAGtC,yEAAyE;iBAC5D,MAAM,GAAG,IAAI;IAS1B,wDAAwD;cAC9C,MAAM,GAAG,OAAO;CAG1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,WAAW,CAqChE"}
|
package/dist/runtime/context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Injected test context —
|
|
2
|
+
* Injected test context — helix's defining mechanism.
|
|
3
3
|
*
|
|
4
4
|
* Every test body (and, later, group hooks) receives a `TestContext` as its
|
|
5
5
|
* FIRST argument: `test("x", ({ assert, client, db, cleanup }) => …)`. The
|
|
@@ -30,24 +30,24 @@ import { registerTestCleanup } from "./test-context.js";
|
|
|
30
30
|
* declaration merging — `declare module "@c9up/helix" { interface TestContext {
|
|
31
31
|
* client: ApiClient } }` — without breaking the core's construction (an external
|
|
32
32
|
* augmentation is not subject to helix's `strictPropertyInitialization`). This
|
|
33
|
-
* is exactly how
|
|
33
|
+
* is exactly how helix's `TestContext` works.
|
|
34
34
|
*/
|
|
35
35
|
export class TestContext {
|
|
36
36
|
/**
|
|
37
|
-
* Add a shared property to every test context —
|
|
38
|
-
* `TestContext.macro('sleep', fn)`, callable on the class itself so a
|
|
37
|
+
* Add a shared property to every test context — helix's
|
|
38
|
+
* `TestContext.macro('sleep', fn)`, callable on the class itself so a helix
|
|
39
39
|
* plugin's registration code ports over unchanged.
|
|
40
40
|
*/
|
|
41
41
|
static macro(name, value) {
|
|
42
42
|
TestContextRegistry.macro(name, value);
|
|
43
43
|
}
|
|
44
|
-
/** Add a lazily-computed, per-context property (
|
|
44
|
+
/** Add a lazily-computed, per-context property (`TestContext.getter`). */
|
|
45
45
|
static getter(name, fn) {
|
|
46
46
|
TestContextRegistry.getter(name, fn);
|
|
47
47
|
}
|
|
48
|
-
/** Chai-flavored assertions (
|
|
48
|
+
/** Chai-flavored assertions (`helix's assert` parity), alongside `expect`. */
|
|
49
49
|
assert;
|
|
50
|
-
/** The running test's own instance — name, options, dataset (
|
|
50
|
+
/** The running test's own instance — name, options, dataset (`ctx.test`). */
|
|
51
51
|
test;
|
|
52
52
|
constructor(test) {
|
|
53
53
|
this.assert = createAssert();
|
|
@@ -55,7 +55,7 @@ export class TestContext {
|
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Register a teardown that runs at the end of THIS test, regardless of
|
|
58
|
-
* outcome (
|
|
58
|
+
* outcome (`ctx.cleanup`). Reverse-insertion order, isolated failures.
|
|
59
59
|
*/
|
|
60
60
|
cleanup(fn) {
|
|
61
61
|
// Falls through to the active per-test frame; a false return means we were
|
|
@@ -67,7 +67,7 @@ const macros = new Map();
|
|
|
67
67
|
const getters = new Map();
|
|
68
68
|
/**
|
|
69
69
|
* Registry through which plugins extend the test context at runtime. Mirrors
|
|
70
|
-
*
|
|
70
|
+
* helix's `TestContext.macro(name, value)` / `TestContext.getter(name, fn)`.
|
|
71
71
|
* Pair each call with a `declare module` augmentation for the types.
|
|
72
72
|
*/
|
|
73
73
|
export const TestContextRegistry = {
|
|
@@ -110,7 +110,7 @@ export function buildTestContext(test) {
|
|
|
110
110
|
const ctx = new TestContext(test);
|
|
111
111
|
// `cleanup` and `test` are structural — the runtime hands them to the body
|
|
112
112
|
// and nothing may take their place. `assert` is NOT: helix ships one, and a
|
|
113
|
-
// project installing
|
|
113
|
+
// project installing `helix's assert` is asking for that one instead. Refusing
|
|
114
114
|
// the override left the plugin registered but never reached, which is how
|
|
115
115
|
// `plugins: [assert()]` could look wired and do nothing.
|
|
116
116
|
const reserved = new Set(["cleanup", "test"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/runtime/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OA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AChC,KAAK;YACL,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;SACd,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC;QAClC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QACjC,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,MAAe,CAAC;QACpB,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE;YAChC,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;YAClB,GAAG;gBACF,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACf,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;oBAC3B,QAAQ,GAAG,IAAI,CAAC;gBACjB,CAAC;gBACD,OAAO,MAAM,CAAC;YACf,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Say something when a finished run cannot drain, instead of hanging silently.
|
|
3
|
+
*
|
|
4
|
+
* Letting the event loop drain on its own is the right default — it is what
|
|
5
|
+
* makes a leaked resource visible instead of swallowed. But visible has to mean
|
|
6
|
+
* SAID: without this the run prints its summary and then stops producing
|
|
7
|
+
* output, which reads as a crash. Under a CI timeout it becomes a non-zero exit
|
|
8
|
+
* for a run in which every test passed.
|
|
9
|
+
*
|
|
10
|
+
* `bin/helix.js` carries its own copy on purpose: it calls the guard from the
|
|
11
|
+
* error path too, where the build may never have been imported, and an exit
|
|
12
|
+
* handler that can fail to load is worse than a duplicated one.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* How long to wait before deciding the loop is stuck. Long enough that a normal
|
|
16
|
+
* teardown — a socket closing, a pool draining — finishes first, short enough
|
|
17
|
+
* that CI does not sit on it.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DRAIN_GRACE_MS = 2000;
|
|
20
|
+
/**
|
|
21
|
+
* Arm the guard for a run that has just finished with `code`.
|
|
22
|
+
*
|
|
23
|
+
* Returns immediately. The timer is `unref`'d, so it never keeps the process
|
|
24
|
+
* alive by itself: if everything closed, it never fires and nothing is printed.
|
|
25
|
+
*
|
|
26
|
+
* @param code The exit code the run produced.
|
|
27
|
+
* @param write Where the diagnostic goes. Defaults to stderr.
|
|
28
|
+
*/
|
|
29
|
+
export declare function armDrainGuard(code: number, write?: (message: string) => void): void;
|
|
30
|
+
//# sourceMappingURL=drain-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drain-guard.d.ts","sourceRoot":"","sources":["../../src/runtime/drain-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAE3B,GACC,IAAI,CAWN"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Say something when a finished run cannot drain, instead of hanging silently.
|
|
3
|
+
*
|
|
4
|
+
* Letting the event loop drain on its own is the right default — it is what
|
|
5
|
+
* makes a leaked resource visible instead of swallowed. But visible has to mean
|
|
6
|
+
* SAID: without this the run prints its summary and then stops producing
|
|
7
|
+
* output, which reads as a crash. Under a CI timeout it becomes a non-zero exit
|
|
8
|
+
* for a run in which every test passed.
|
|
9
|
+
*
|
|
10
|
+
* `bin/helix.js` carries its own copy on purpose: it calls the guard from the
|
|
11
|
+
* error path too, where the build may never have been imported, and an exit
|
|
12
|
+
* handler that can fail to load is worse than a duplicated one.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* How long to wait before deciding the loop is stuck. Long enough that a normal
|
|
16
|
+
* teardown — a socket closing, a pool draining — finishes first, short enough
|
|
17
|
+
* that CI does not sit on it.
|
|
18
|
+
*/
|
|
19
|
+
export const DRAIN_GRACE_MS = 2000;
|
|
20
|
+
/**
|
|
21
|
+
* Arm the guard for a run that has just finished with `code`.
|
|
22
|
+
*
|
|
23
|
+
* Returns immediately. The timer is `unref`'d, so it never keeps the process
|
|
24
|
+
* alive by itself: if everything closed, it never fires and nothing is printed.
|
|
25
|
+
*
|
|
26
|
+
* @param code The exit code the run produced.
|
|
27
|
+
* @param write Where the diagnostic goes. Defaults to stderr.
|
|
28
|
+
*/
|
|
29
|
+
export function armDrainGuard(code, write = (message) => {
|
|
30
|
+
process.stderr.write(message);
|
|
31
|
+
}) {
|
|
32
|
+
const timer = setTimeout(() => {
|
|
33
|
+
write(`\nhelix: the run finished (exit ${code}) but the process is still alive after ${DRAIN_GRACE_MS}ms.\n` +
|
|
34
|
+
`helix: still open: ${describeOpenResources()}\n` +
|
|
35
|
+
"helix: a test left something running — an open server, a timer, a database handle. Close it in a teardown hook,\n" +
|
|
36
|
+
"helix: or set `forceExit: true` in the tests config (or pass --force-exit) to exit anyway.\n");
|
|
37
|
+
process.exit(code);
|
|
38
|
+
}, DRAIN_GRACE_MS);
|
|
39
|
+
timer.unref();
|
|
40
|
+
}
|
|
41
|
+
/** What Node still has open, counted by kind. */
|
|
42
|
+
function describeOpenResources() {
|
|
43
|
+
const resources = typeof process.getActiveResourcesInfo === "function"
|
|
44
|
+
? process.getActiveResourcesInfo()
|
|
45
|
+
: [];
|
|
46
|
+
const counted = new Map();
|
|
47
|
+
for (const name of resources) {
|
|
48
|
+
counted.set(name, (counted.get(name) ?? 0) + 1);
|
|
49
|
+
}
|
|
50
|
+
if (counted.size === 0)
|
|
51
|
+
return "nothing Node can name";
|
|
52
|
+
return [...counted]
|
|
53
|
+
.map(([name, n]) => (n > 1 ? `${name} x${n}` : name))
|
|
54
|
+
.join(", ");
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=drain-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drain-guard.js","sourceRoot":"","sources":["../../src/runtime/drain-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC5B,IAAY,EACZ,QAAmC,CAAC,OAAO,EAAE,EAAE;IAC9C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;QAC7B,KAAK,CACJ,mCAAmC,IAAI,0CAA0C,cAAc,OAAO;YACrG,sBAAsB,qBAAqB,EAAE,IAAI;YACjD,mHAAmH;YACnH,8FAA8F,CAC/F,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC,EAAE,cAAc,CAAC,CAAC;IACnB,KAAK,CAAC,KAAK,EAAE,CAAC;AACf,CAAC;AAED,iDAAiD;AACjD,SAAS,qBAAqB;IAC7B,MAAM,SAAS,GACd,OAAO,OAAO,CAAC,sBAAsB,KAAK,UAAU;QACnD,CAAC,CAAC,OAAO,CAAC,sBAAsB,EAAE;QAClC,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,uBAAuB,CAAC;IACvD,OAAO,CAAC,GAAG,OAAO,CAAC;SACjB,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACpD,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Runner events — the
|
|
2
|
+
* Runner events — the helix `Emitter` surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* helix's plugin/reporter topology is built on an event emitter: a plugin
|
|
5
5
|
* receives `{ config, cliArgs, runner, emitter }` and subscribes to
|
|
6
6
|
* `runner:start`, `suite:start`, `group:start`, `test:start`, … to observe the
|
|
7
7
|
* run. Helix emits the SAME event names with the SAME node shapes
|
|
8
|
-
* (`TestStartNode`, `TestEndNode`, `GroupStartNode`, …) so a
|
|
8
|
+
* (`TestStartNode`, `TestEndNode`, `GroupStartNode`, …) so a helix reporter or
|
|
9
9
|
* plugin can be ported without rewriting its listeners.
|
|
10
10
|
*
|
|
11
|
-
* One named deviation from
|
|
11
|
+
* One named deviation from `helix`: `suite:start` / `suite:end` carry the
|
|
12
12
|
* test FILE name. Helix runs one process per file, so the file is what a
|
|
13
13
|
* worker-side listener can see of a suite.
|
|
14
14
|
*
|
|
15
|
-
* `errors[].error` is the thrown `Error` itself, as in
|
|
15
|
+
* `errors[].error` is the thrown `Error` itself, as in helix — the emitter runs
|
|
16
16
|
* in the worker, where the original is still around. Only an error rebuilt from
|
|
17
17
|
* an IPC frame (which can carry data only) degrades to the {@link
|
|
18
18
|
* SerializedError} shape, which keeps the same `name`/`message`/`stack` fields.
|
|
19
19
|
*/
|
|
20
20
|
import type { SerializedError } from "./run.js";
|
|
21
|
-
/** The lifecycle phase an error was raised in
|
|
21
|
+
/** The lifecycle phase an error was raised in. */
|
|
22
22
|
export type ErrorPhase = "setup" | "test" | "setup:cleanup" | "teardown" | "teardown:cleanup" | "test:cleanup";
|
|
23
23
|
/**
|
|
24
24
|
* One captured failure, tagged with the phase it happened in. `error` is the
|
|
@@ -29,7 +29,7 @@ export interface EmittedError {
|
|
|
29
29
|
phase: ErrorPhase;
|
|
30
30
|
error: Error | SerializedError;
|
|
31
31
|
}
|
|
32
|
-
/** A test title, before and after dataset interpolation
|
|
32
|
+
/** A test title, before and after dataset interpolation. */
|
|
33
33
|
export interface EmittedTitle {
|
|
34
34
|
original: string;
|
|
35
35
|
expanded: string;
|
|
@@ -41,17 +41,17 @@ export interface EmittedDataset {
|
|
|
41
41
|
row: unknown;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Shared shape of `test:start` / `test:end` —
|
|
44
|
+
* Shared shape of `test:start` / `test:end` — helix's `TestOptions`, field for
|
|
45
45
|
* field. Only `title`, `tags`, `timeout`, `meta` and `isPinned` always carry a
|
|
46
46
|
* value; the rest appear when the corresponding modifier was used, so a
|
|
47
|
-
* reporter that probes for a key sees what
|
|
47
|
+
* reporter that probes for a key sees what helix would show it.
|
|
48
48
|
*/
|
|
49
49
|
interface TestNodeBase {
|
|
50
50
|
title: EmittedTitle;
|
|
51
51
|
tags: string[];
|
|
52
52
|
timeout: number;
|
|
53
53
|
waitsForDone?: boolean;
|
|
54
|
-
/** The test body, as
|
|
54
|
+
/** The test body, as helix hands it over. Absent on a `todo`. */
|
|
55
55
|
executor?: (...args: never[]) => unknown;
|
|
56
56
|
retries?: number;
|
|
57
57
|
retryAttempt?: number;
|
|
@@ -92,7 +92,7 @@ export type SuiteEndNode = SuiteStartNode & {
|
|
|
92
92
|
errors: EmittedError[];
|
|
93
93
|
};
|
|
94
94
|
/**
|
|
95
|
-
* Payload of `runner:start`.
|
|
95
|
+
* Payload of `runner:start`. helix types this as `{}`; helix spells the same
|
|
96
96
|
* "no fields" shape as an empty record so no lint suppression is needed.
|
|
97
97
|
*/
|
|
98
98
|
export type RunnerStartNode = Record<string, never>;
|
|
@@ -100,7 +100,7 @@ export type RunnerStartNode = Record<string, never>;
|
|
|
100
100
|
export interface RunnerEndNode {
|
|
101
101
|
hasError: boolean;
|
|
102
102
|
}
|
|
103
|
-
/** Every event the runtime emits, with its payload (
|
|
103
|
+
/** Every event the runtime emits, with its payload (`RunnerEvents`). */
|
|
104
104
|
export interface RunnerEvents {
|
|
105
105
|
"test:start": TestStartNode;
|
|
106
106
|
"test:end": TestEndNode;
|
|
@@ -115,7 +115,7 @@ export interface RunnerEvents {
|
|
|
115
115
|
export type EventHandler<E extends keyof RunnerEvents> = (payload: RunnerEvents[E]) => void;
|
|
116
116
|
/**
|
|
117
117
|
* A typed event emitter over {@link RunnerEvents}. Deliberately minimal — `on`
|
|
118
|
-
* / `once` / `off` / `emit`, the surface a
|
|
118
|
+
* / `once` / `off` / `emit`, the surface a helix reporter or plugin uses. A
|
|
119
119
|
* throwing listener is reported on stderr and never fails the run.
|
|
120
120
|
*/
|
|
121
121
|
export declare class Emitter {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/runtime/emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/runtime/emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,kDAAkD;AAClD,MAAM,MAAM,UAAU,GACnB,OAAO,GACP,MAAM,GACN,eAAe,GACf,UAAU,GACV,kBAAkB,GAClB,cAAc,CAAC;AAElB;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,eAAe,CAAC;CAC/B;AAED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C,CAAC,CAAC,GAAG,IAAI;IAQ5E,+CAA+C;IAC/C,GAAG,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI;IAS3E,mEAAmE;IACnE,KAAK,IAAI,IAAI;IAIb,0DAA0D;IAC1D,IAAI,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI;CAY5E;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,SAAgB,CAAC"}
|
package/dist/runtime/emitter.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Runner events — the
|
|
2
|
+
* Runner events — the helix `Emitter` surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* helix's plugin/reporter topology is built on an event emitter: a plugin
|
|
5
5
|
* receives `{ config, cliArgs, runner, emitter }` and subscribes to
|
|
6
6
|
* `runner:start`, `suite:start`, `group:start`, `test:start`, … to observe the
|
|
7
7
|
* run. Helix emits the SAME event names with the SAME node shapes
|
|
8
|
-
* (`TestStartNode`, `TestEndNode`, `GroupStartNode`, …) so a
|
|
8
|
+
* (`TestStartNode`, `TestEndNode`, `GroupStartNode`, …) so a helix reporter or
|
|
9
9
|
* plugin can be ported without rewriting its listeners.
|
|
10
10
|
*
|
|
11
|
-
* One named deviation from
|
|
11
|
+
* One named deviation from `helix`: `suite:start` / `suite:end` carry the
|
|
12
12
|
* test FILE name. Helix runs one process per file, so the file is what a
|
|
13
13
|
* worker-side listener can see of a suite.
|
|
14
14
|
*
|
|
15
|
-
* `errors[].error` is the thrown `Error` itself, as in
|
|
15
|
+
* `errors[].error` is the thrown `Error` itself, as in helix — the emitter runs
|
|
16
16
|
* in the worker, where the original is still around. Only an error rebuilt from
|
|
17
17
|
* an IPC frame (which can carry data only) degrades to the {@link
|
|
18
18
|
* SerializedError} shape, which keeps the same `name`/`message`/`stack` fields.
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
21
|
* A typed event emitter over {@link RunnerEvents}. Deliberately minimal — `on`
|
|
22
|
-
* / `once` / `off` / `emit`, the surface a
|
|
22
|
+
* / `once` / `off` / `emit`, the surface a helix reporter or plugin uses. A
|
|
23
23
|
* throwing listener is reported on stderr and never fails the run.
|
|
24
24
|
*/
|
|
25
25
|
export class Emitter {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `runnerHooks` — run ONCE for the whole run, where
|
|
2
|
+
* `runnerHooks` — run ONCE for the whole run, where helix runs them.
|
|
3
3
|
*
|
|
4
4
|
* These were running per worker process, which meant a migration in
|
|
5
5
|
* `runnerHooks.setup` ran once per FILE. The reason given was that a resource
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `runnerHooks` — run ONCE for the whole run, where
|
|
2
|
+
* `runnerHooks` — run ONCE for the whole run, where helix runs them.
|
|
3
3
|
*
|
|
4
4
|
* These were running per worker process, which meant a migration in
|
|
5
5
|
* `runnerHooks.setup` ran once per FILE. The reason given was that a resource
|
package/dist/runtime/run.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface TestResult {
|
|
|
14
14
|
status: "pass" | "fail" | "skip" | "todo";
|
|
15
15
|
durationMs: number;
|
|
16
16
|
error?: SerializedError;
|
|
17
|
-
/** Lifecycle phase `error` was raised in (
|
|
17
|
+
/** Lifecycle phase `error` was raised in (`test:end`). */
|
|
18
18
|
errorPhase?: ErrorPhase;
|
|
19
19
|
}
|
|
20
20
|
export interface SuiteResult {
|
|
@@ -47,7 +47,7 @@ export interface FileResult {
|
|
|
47
47
|
durationMs: number;
|
|
48
48
|
/**
|
|
49
49
|
* Full names of the tests marked `.pin()` — only populated under
|
|
50
|
-
* `--list-pinned`, where
|
|
50
|
+
* `--list-pinned`, where helix collects the files, prints what is pinned, and
|
|
51
51
|
* runs nothing.
|
|
52
52
|
*/
|
|
53
53
|
pinned?: string[];
|
|
@@ -70,32 +70,32 @@ export interface ExecuteOptions {
|
|
|
70
70
|
*/
|
|
71
71
|
grep?: string;
|
|
72
72
|
/**
|
|
73
|
-
* Tag filter expressions (
|
|
73
|
+
* Tag filter expressions (`--tags`). A `~`-prefixed tag EXCLUDES (`!` is
|
|
74
74
|
* also accepted). Required tags are OR-ed by default — a test runs when it
|
|
75
75
|
* carries ANY of them — unless {@link ExecuteOptions.matchAll} is set, and
|
|
76
76
|
* never when it carries an excluded tag.
|
|
77
77
|
*/
|
|
78
78
|
tags?: string[];
|
|
79
|
-
/** Require ALL required tags instead of any (
|
|
79
|
+
/** Require ALL required tags instead of any (`--match-all`). */
|
|
80
80
|
matchAll?: boolean;
|
|
81
|
-
/** Exact test titles to run (
|
|
81
|
+
/** Exact test titles to run (`--tests`). A test runs only if its leaf title is listed. */
|
|
82
82
|
tests?: string[];
|
|
83
|
-
/** Exact group titles to run (
|
|
83
|
+
/** Exact group titles to run (`--groups`). A test runs only if its enclosing group is listed. */
|
|
84
84
|
groups?: string[];
|
|
85
85
|
/**
|
|
86
86
|
* The suite these tests belong to — `ctx.test.options.meta.suite.name` and the
|
|
87
|
-
* `suite:*` event payloads. Defaults to `"default"`,
|
|
87
|
+
* `suite:*` event payloads. Defaults to `"default"`, the implicit suite.
|
|
88
88
|
*/
|
|
89
89
|
suite?: string;
|
|
90
90
|
/**
|
|
91
|
-
* Stop running once a test fails (
|
|
92
|
-
* failure is reported as SKIPPED, not dropped —
|
|
91
|
+
* Stop running once a test fails (`--bail`). Everything after the
|
|
92
|
+
* failure is reported as SKIPPED, not dropped — not dropped, so the counts
|
|
93
93
|
* still add up.
|
|
94
94
|
*/
|
|
95
95
|
bail?: boolean;
|
|
96
96
|
/**
|
|
97
|
-
* How far a bail reaches (
|
|
98
|
-
* group only, `"suite"` the rest of the file, `"runner"` (
|
|
97
|
+
* How far a bail reaches (`--bail-layer`): `"group"` stops the enclosing
|
|
98
|
+
* group only, `"suite"` the rest of the file, `"runner"` (helix's default,
|
|
99
99
|
* spelled `""` on its CLI) the rest of the run — the remaining FILES are
|
|
100
100
|
* dropped by the pool, since helix runs one process per file and cannot skip
|
|
101
101
|
* tests it never collected.
|
|
@@ -105,9 +105,9 @@ export interface ExecuteOptions {
|
|
|
105
105
|
/** The value a {@link SerializedError} was built from, when it is still around. */
|
|
106
106
|
export declare function thrownValue(error: SerializedError): unknown;
|
|
107
107
|
/**
|
|
108
|
-
* The suite a run belongs to (
|
|
108
|
+
* The suite a run belongs to (`meta.suite`). Helix runs one process per
|
|
109
109
|
* FILE, so the suite is a name the run carries — `"default"` unless
|
|
110
|
-
* `configure({ suite })` or `--suite` says otherwise, exactly like
|
|
110
|
+
* `configure({ suite })` or `--suite` says otherwise, exactly like the
|
|
111
111
|
* implicit suite.
|
|
112
112
|
*/
|
|
113
113
|
export interface SuiteIdentity {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/runtime/run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAGN,KAAK,UAAU,EAGf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAOX,SAAS,EAGT,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/runtime/run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAGN,KAAK,UAAU,EAGf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAOX,SAAS,EAGT,MAAM,YAAY,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