@c9up/helix-plugin-ream 0.1.1 → 0.1.3

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The bridge between [Ream](https://github.com/C9up/ream) and [helix](https://github.com/C9up/helix), its test runner.
4
4
 
5
- Ream knows nothing about helix, helix knows nothing about Ream. The plugin that joins them lives here and declares both sides as peers — the same shape as `@japa/plugin-adonisjs`.
5
+ Ream knows nothing about helix, helix knows nothing about Ream. The plugin that joins them lives here and declares both sides as peers — the same shape AdonisJS uses to join its own runner to the framework.
6
6
 
7
7
  ## Install
8
8
 
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The AdonisJS stratification, kept intact: the FRAMEWORK reads its rc file and
5
5
  * hands the suites to the runner, exactly as `@adonisjs/core` reads
6
- * `adonisrc.ts` and hands them to Japa. The runner itself (helix) knows nothing
6
+ * `adonisrc.ts` and hands them to helix. The runner itself (helix) knows nothing
7
7
  * about ream, and ream owns no test execution — it only translates.
8
8
  *
9
9
  * // bin/test.ts
@@ -16,7 +16,7 @@
16
16
  * to be re-imported in each worker, so the runner needs the module's PATH, not
17
17
  * just the object it exported. `runTests` takes it as `configModule`, and
18
18
  * REFUSES to run when a suite declares a callback it was given no way to
19
- * deliver — in Japa a declared `configure` runs, so a run that skipped it would
19
+ * deliver — in helix a declared `configure` runs, so a run that skipped it would
20
20
  * be green in a state its own config does not describe.
21
21
  */
22
22
  import type { TestsConfig } from "@c9up/ream";
@@ -57,7 +57,7 @@ export declare class UnknownSuiteError extends Error {
57
57
  /**
58
58
  * A suite declares `configure`, but this entry point cannot deliver it.
59
59
  *
60
- * Not a warning: Japa runs a declared `configure`, so carrying on would run the
60
+ * Not a warning: helix runs a declared `configure`, so carrying on would run the
61
61
  * suite in a state its own config does not describe — and a warning is exactly
62
62
  * what gets scrolled past in CI.
63
63
  */
@@ -67,7 +67,7 @@ export declare class SuiteConfigureUnreachableError extends Error {
67
67
  /**
68
68
  * The flags the worker processes are spawned with.
69
69
  *
70
- * Split out because it is a decision, not plumbing: the Japa alias loader
70
+ * Split out because it is a decision, not plumbing: the helix alias loader
71
71
  * redirects a package specifier, so it goes in only when a project asks. It
72
72
  * rides ALONGSIDE whatever loader is already there — the test files still need
73
73
  * theirs to read TypeScript.
@@ -1 +1 @@
1
- {"version":3,"file":"runTests.d.ts","sourceRoot":"","sources":["../src/runTests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,YAAY,CAAC;AAG/D,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC/B,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,2DAA2D;AAC3D,qBAAa,iBAAkB,SAAQ,KAAK;gBAC/B,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE;CAQ5C;AAED;;;;;;GAMG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;gBAC5C,KAAK,EAAE,MAAM,EAAE;CAU3B;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,OAAO,EAAE,eAAe,GACtB,MAAM,EAAE,CAEV;AAkBD;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAC7B,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B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CAAC,CAyGjB;AA2BD;;;GAGG;AACH,wBAAsB,kBAAkB,CACvC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,eAAoB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
package/dist/runTests.js CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The AdonisJS stratification, kept intact: the FRAMEWORK reads its rc file and
5
5
  * hands the suites to the runner, exactly as `@adonisjs/core` reads
6
- * `adonisrc.ts` and hands them to Japa. The runner itself (helix) knows nothing
6
+ * `adonisrc.ts` and hands them to helix. The runner itself (helix) knows nothing
7
7
  * about ream, and ream owns no test execution — it only translates.
8
8
  *
9
9
  * // bin/test.ts
@@ -16,7 +16,7 @@
16
16
  * to be re-imported in each worker, so the runner needs the module's PATH, not
17
17
  * just the object it exported. `runTests` takes it as `configModule`, and
18
18
  * REFUSES to run when a suite declares a callback it was given no way to
19
- * deliver — in Japa a declared `configure` runs, so a run that skipped it would
19
+ * deliver — in helix a declared `configure` runs, so a run that skipped it would
20
20
  * be green in a state its own config does not describe.
21
21
  */
22
22
  import path from "node:path";
@@ -34,7 +34,7 @@ export class UnknownSuiteError extends Error {
34
34
  /**
35
35
  * A suite declares `configure`, but this entry point cannot deliver it.
36
36
  *
37
- * Not a warning: Japa runs a declared `configure`, so carrying on would run the
37
+ * Not a warning: helix runs a declared `configure`, so carrying on would run the
38
38
  * suite in a state its own config does not describe — and a warning is exactly
39
39
  * what gets scrolled past in CI.
40
40
  */
@@ -51,7 +51,7 @@ export class SuiteConfigureUnreachableError extends Error {
51
51
  /**
52
52
  * The flags the worker processes are spawned with.
53
53
  *
54
- * Split out because it is a decision, not plumbing: the Japa alias loader
54
+ * Split out because it is a decision, not plumbing: the helix alias loader
55
55
  * redirects a package specifier, so it goes in only when a project asks. It
56
56
  * rides ALONGSIDE whatever loader is already there — the test files still need
57
57
  * theirs to read TypeScript.
@@ -106,7 +106,7 @@ export async function runTests(tests, options = {}) {
106
106
  // should not pay for.
107
107
  const configuring = selected.filter((suite) => typeof suite.configure === "function");
108
108
  if (configuring.length > 0 && options.configModule === undefined) {
109
- // In Japa a declared `configure` RUNS. It cannot here — the callback needs
109
+ // In helix a declared `configure` RUNS. It cannot here — the callback needs
110
110
  // the module's path to be re-imported in each worker, and this entry was
111
111
  // handed the exported object. Running anyway would produce a green suite
112
112
  // configured differently from what the rc file says, so the run stops.
@@ -126,7 +126,7 @@ export async function runTests(tests, options = {}) {
126
126
  bail: options.bail,
127
127
  };
128
128
  // `runnerHooks` run ONCE around the whole run, here, and the workers skip
129
- // them — Japa's semantics, and the difference between migrating once and
129
+ // them — helix's semantics, and the difference between migrating once and
130
130
  // migrating once per test file.
131
131
  const dropGlobalHooks = await helix.runGlobalHooks(bootstrap);
132
132
  // No suites declared: run whatever the project's discovery finds, so an app
@@ -134,7 +134,7 @@ export async function runTests(tests, options = {}) {
134
134
  if (selected.length === 0) {
135
135
  try {
136
136
  const outcome = await helix.run(base);
137
- return finish(outcome.exitCode, forceExit);
137
+ return finish(outcome.exitCode, forceExit, helix.armDrainGuard);
138
138
  }
139
139
  finally {
140
140
  await dropGlobalHooks();
@@ -164,27 +164,34 @@ export async function runTests(tests, options = {}) {
164
164
  }
165
165
  if (steps.length === 0) {
166
166
  await dropGlobalHooks();
167
- return finish(0, forceExit);
167
+ return finish(0, forceExit, helix.armDrainGuard);
168
168
  }
169
169
  try {
170
170
  const outcome = await helix.runSuites(steps, base);
171
- return finish(outcome.exitCode, forceExit);
171
+ return finish(outcome.exitCode, forceExit, helix.armDrainGuard);
172
172
  }
173
173
  finally {
174
174
  await dropGlobalHooks();
175
175
  }
176
176
  }
177
177
  /**
178
- * Apply `tests.forceExit`. Japa does this inside its own run — sets the exit
178
+ * Apply `tests.forceExit`. helix does this inside its own run — sets the exit
179
179
  * code, then `process.exit()` — rather than leaving it to the caller, because
180
180
  * the whole point is to not wait for the event loop to drain. A run that
181
181
  * force-exits never returns here; the value is for every other run.
182
182
  */
183
- function finish(code, forceExit) {
183
+ function finish(code, forceExit, armDrainGuard) {
184
184
  if (forceExit) {
185
185
  process.exitCode = code;
186
186
  process.exit();
187
187
  }
188
+ // Without forceExit the loop is left to drain on its own, which is the right
189
+ // default — a leaked handle should be visible, not swallowed. But visible has
190
+ // to mean SAID: `ream test` used to print its summary and then hang with no
191
+ // further output, and under a CI timeout that is a non-zero exit for a run in
192
+ // which every test passed. helix's own CLI already said so; this entry point
193
+ // did not, and it is the one `ream test` goes through.
194
+ armDrainGuard(code);
188
195
  return code;
189
196
  }
190
197
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"runTests.js","sourceRoot":"","sources":["../src/runTests.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiC9C,2DAA2D;AAC3D,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,IAAY,EAAE,QAAkB;QAC3C,KAAK,CACJ,QAAQ,CAAC,MAAM,KAAK,CAAC;YACpB,CAAC,CAAC,uBAAuB,IAAI,+BAA+B;YAC5D,CAAC,CAAC,uBAAuB,IAAI,gBAAgB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACpE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IACjC,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACxD,YAAY,KAAe;QAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAChC,KAAK,CACJ,QAAQ,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,IAA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QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACrE,MAAM,EAAE,GACP,QAAQ,KAAK,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAChD,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,QAAQ,CAAC;QAChD,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,KAAK,GACV,EAAE,KAAK,IAAI,IAAI,OAAO,EAAE,KAAK,QAAQ;QACpC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC;QAC1B,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE;QACzD,GAAG,OAAO;QACV,IAAI;QACJ,YAAY,EAAE,QAAQ;KACtB,CAAC,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,SAAS,aAAa,CAAC,KAAc;IACpC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c9up/helix-plugin-ream",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Helix plugin for Ream — boots a Ream app under test and injects a TestClient on the test context",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,13 +17,13 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@c9up/helix": "^0.1.9",
21
- "@c9up/ream": "^0.1.27"
20
+ "@c9up/helix": "^0.2.3",
21
+ "@c9up/ream": "^0.2.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@biomejs/biome": "^2.4.10",
25
- "@c9up/helix": "^0.1.9",
26
- "@c9up/ream": "^0.1.27",
25
+ "@c9up/helix": "^0.2.3",
26
+ "@c9up/ream": "^0.2.0",
27
27
  "@types/node": "^22.19.15",
28
28
  "tsx": "^4",
29
29
  "typescript": "^6.0.2",
package/src/runTests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The AdonisJS stratification, kept intact: the FRAMEWORK reads its rc file and
5
5
  * hands the suites to the runner, exactly as `@adonisjs/core` reads
6
- * `adonisrc.ts` and hands them to Japa. The runner itself (helix) knows nothing
6
+ * `adonisrc.ts` and hands them to helix. The runner itself (helix) knows nothing
7
7
  * about ream, and ream owns no test execution — it only translates.
8
8
  *
9
9
  * // bin/test.ts
@@ -16,7 +16,7 @@
16
16
  * to be re-imported in each worker, so the runner needs the module's PATH, not
17
17
  * just the object it exported. `runTests` takes it as `configModule`, and
18
18
  * REFUSES to run when a suite declares a callback it was given no way to
19
- * deliver — in Japa a declared `configure` runs, so a run that skipped it would
19
+ * deliver — in helix a declared `configure` runs, so a run that skipped it would
20
20
  * be green in a state its own config does not describe.
21
21
  */
22
22
 
@@ -71,7 +71,7 @@ export class UnknownSuiteError extends Error {
71
71
  /**
72
72
  * A suite declares `configure`, but this entry point cannot deliver it.
73
73
  *
74
- * Not a warning: Japa runs a declared `configure`, so carrying on would run the
74
+ * Not a warning: helix runs a declared `configure`, so carrying on would run the
75
75
  * suite in a state its own config does not describe — and a warning is exactly
76
76
  * what gets scrolled past in CI.
77
77
  */
@@ -91,7 +91,7 @@ export class SuiteConfigureUnreachableError extends Error {
91
91
  /**
92
92
  * The flags the worker processes are spawned with.
93
93
  *
94
- * Split out because it is a decision, not plumbing: the Japa alias loader
94
+ * Split out because it is a decision, not plumbing: the helix alias loader
95
95
  * redirects a package specifier, so it goes in only when a project asks. It
96
96
  * rides ALONGSIDE whatever loader is already there — the test files still need
97
97
  * theirs to read TypeScript.
@@ -162,7 +162,7 @@ export async function runTests(
162
162
  (suite) => typeof suite.configure === "function",
163
163
  );
164
164
  if (configuring.length > 0 && options.configModule === undefined) {
165
- // In Japa a declared `configure` RUNS. It cannot here — the callback needs
165
+ // In helix a declared `configure` RUNS. It cannot here — the callback needs
166
166
  // the module's path to be re-imported in each worker, and this entry was
167
167
  // handed the exported object. Running anyway would produce a green suite
168
168
  // configured differently from what the rc file says, so the run stops.
@@ -186,7 +186,7 @@ export async function runTests(
186
186
  };
187
187
 
188
188
  // `runnerHooks` run ONCE around the whole run, here, and the workers skip
189
- // them — Japa's semantics, and the difference between migrating once and
189
+ // them — helix's semantics, and the difference between migrating once and
190
190
  // migrating once per test file.
191
191
  const dropGlobalHooks = await helix.runGlobalHooks(bootstrap);
192
192
 
@@ -195,7 +195,7 @@ export async function runTests(
195
195
  if (selected.length === 0) {
196
196
  try {
197
197
  const outcome = await helix.run(base);
198
- return finish(outcome.exitCode, forceExit);
198
+ return finish(outcome.exitCode, forceExit, helix.armDrainGuard);
199
199
  } finally {
200
200
  await dropGlobalHooks();
201
201
  }
@@ -229,28 +229,39 @@ export async function runTests(
229
229
  }
230
230
  if (steps.length === 0) {
231
231
  await dropGlobalHooks();
232
- return finish(0, forceExit);
232
+ return finish(0, forceExit, helix.armDrainGuard);
233
233
  }
234
234
 
235
235
  try {
236
236
  const outcome = await helix.runSuites(steps, base);
237
- return finish(outcome.exitCode, forceExit);
237
+ return finish(outcome.exitCode, forceExit, helix.armDrainGuard);
238
238
  } finally {
239
239
  await dropGlobalHooks();
240
240
  }
241
241
  }
242
242
 
243
243
  /**
244
- * Apply `tests.forceExit`. Japa does this inside its own run — sets the exit
244
+ * Apply `tests.forceExit`. helix does this inside its own run — sets the exit
245
245
  * code, then `process.exit()` — rather than leaving it to the caller, because
246
246
  * the whole point is to not wait for the event loop to drain. A run that
247
247
  * force-exits never returns here; the value is for every other run.
248
248
  */
249
- function finish(code: number, forceExit: boolean): number {
249
+ function finish(
250
+ code: number,
251
+ forceExit: boolean,
252
+ armDrainGuard: (code: number) => void,
253
+ ): number {
250
254
  if (forceExit) {
251
255
  process.exitCode = code;
252
256
  process.exit();
253
257
  }
258
+ // Without forceExit the loop is left to drain on its own, which is the right
259
+ // default — a leaked handle should be visible, not swallowed. But visible has
260
+ // to mean SAID: `ream test` used to print its summary and then hang with no
261
+ // further output, and under a CI timeout that is a non-zero exit for a run in
262
+ // which every test passed. helix's own CLI already said so; this entry point
263
+ // did not, and it is the one `ream test` goes through.
264
+ armDrainGuard(code);
254
265
  return code;
255
266
  }
256
267