@activate-core/test-forge 2.4.0 → 2.4.1

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
@@ -458,7 +458,11 @@ file, outside any test. `--no-scan` skips the look-up.
458
458
  (`REQUIRED_PACKAGES`, a database client say). When the project lacks one,
459
459
  `run` stops that area before running anything and prints the `npm i -D` to
460
460
  run, instead of every test failing as if the product were broken. A test that
461
- still hits it is reported as skipped with that reason. `run` also says when
461
+ still hits it is reported as skipped with that reason. The same goes for the
462
+ testkit's sign-in check: it uses an endpoint no journey tests, and when the
463
+ server answers it with an error (a 5xx, a 429) the tests that need that role are
464
+ reported as not started, with the status and the endpoint, not as failing their
465
+ rules. `run` also says when
462
466
  `TESTFORGE_KEY` is set but `dashboardUrl` is empty, so a run that will not be
463
467
  published is not a surprise.
464
468
 
@@ -105,6 +105,14 @@ export const HARNESS_CONTRACT = [
105
105
  ` - ensureToken() confirms a cached token with one cheap authenticated call,`,
106
106
  ` once per process and again after any refusal, and mints a new one if`,
107
107
  ` needed. login(), apiContext() and call() all go through it.`,
108
+ ` - That check uses the lightest authenticated endpoint the role can call,`,
109
+ ` one that only says who is signed in, never a screen's data endpoint that`,
110
+ ` a journey tests: a bug there would stop every test before it starts.`,
111
+ ` - Only 401 or 403 means the token is refused: mint a new one once. Any other`,
112
+ ` answer (a 5xx, a 429, no answer) is the server's, not the token's: do not`,
113
+ ` mint again and do not retry per test. Remember it for the process and`,
114
+ ` throw "testkit: token check <METHOD> <path> answered <status>" so every`,
115
+ ` test that needs that role fails at once with the same reason.`,
108
116
  ` - Check connections by their live state and reopen them if closed; do not`,
109
117
  ` use "already set up" flags. Tests never disconnect the shared connection.`,
110
118
  `H5. Nothing destructive outside test data.`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activate-core/test-forge",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "AI-powered QA automation. Scans a project, drafts journey docs, and generates seeded Jest/Playwright tests. Works in any project, with any AI CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -413,8 +413,15 @@ function waitingFor(raw) {
413
413
  // the testkit needs is not installed): reported as skipped with what to do, never
414
414
  // as a product defect.
415
415
  function environmentFor(raw) {
416
- const m = /testkit: missing package ([^\s]+) — run: (npm i -D [^\n]+)/.exec(strip(String(raw || '')));
417
- return m ? `Environment: package ${m[1]} is not installed — run: ${m[2].trim()}` : undefined;
416
+ const text = strip(String(raw || ''));
417
+ const m = /testkit: missing package ([^\s]+) — run: (npm i -D [^\n]+)/.exec(text);
418
+ if (m) return `Environment: package ${m[1]} is not installed — run: ${m[2].trim()}`;
419
+ // The testkit's sign-in check got an error from the server: the test never
420
+ // started, so its rule was not checked. The endpoint's own fault is reported
421
+ // by the tests of that endpoint, not by every test that signs in.
422
+ const t = /testkit: token check (\w+ \S+) answered (5\d\d|429)\b/.exec(text);
423
+ if (t) return `Environment: the server answered ${t[2]} to the testkit's sign-in check (${t[1]}), so this test could not start`;
424
+ return undefined;
418
425
  }
419
426
 
420
427
  // Why a failed test is not the product's: it waits for a name, or the environment lacks something.