@activate-core/test-forge 2.4.0 → 2.4.2

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,13 @@ 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 that
463
+ endpoint answers with anything but a 200 the testkit signs in afresh once and
464
+ carries on, so one broken endpoint never stops the suite. A run signs each role
465
+ in once, not once per test file. A testkit built before this that still stops on
466
+ the check has its failures reported as not started, with the status and the
467
+ endpoint, not as failing their rules. `run` also says when
462
468
  `TESTFORGE_KEY` is set but `dashboardUrl` is empty, so a run that will not be
463
469
  published is not a surprise.
464
470
 
@@ -105,6 +105,18 @@ 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 a 200 confirms a token. Any other answer (a refusal, a 5xx from a bug`,
112
+ ` or a local database behind the schema, a 429) leaves it unconfirmed: mint`,
113
+ ` a fresh one once through the real login and use it, so one broken endpoint`,
114
+ ` never stops every test. Never retry the check per test.`,
115
+ ` - Each test file loads the testkit anew: a token minted by another file of`,
116
+ ` the run in the last few minutes (cached with the time it was minted) is`,
117
+ ` used as it is, so a run logs each role in once, not once per file.`,
118
+ ` - When the login itself fails, throw "testkit: login as <identifier> failed`,
119
+ ` (<status>)": that, not the check, is what stops the role's tests.`,
108
120
  ` - Check connections by their live state and reopen them if closed; do not`,
109
121
  ` use "already set up" flags. Tests never disconnect the shared connection.`,
110
122
  `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.2",
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.