@activate-core/test-forge 2.2.0 → 2.2.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.
@@ -39,7 +39,7 @@ const NOT_A_REASON = [
39
39
  /\b(?:second|two|distinct|another|different) (?:\w+ )?(?:customer|account|user|people|person)s?\b/i,
40
40
  ];
41
41
  /** The only reasons a rule cannot be tested: an outside service the test cannot drive. */
42
- const OUTSIDE = /\b(?:stripe|payment (?:provider|processor|gateway)|card (?:network|issuer|authori[sz]ation)|3-?d ?secure|third[- ]party|external (?:service|system|provider|site)|e-?mail|inbox|sms|text message|push notification|google|routing provider|maps? (?:api|provider)|mapbox|tomtom|another app|mobile app|washer app|operator app|native app|another tab|other tab|second tab|two tabs|iframe|captcha|clock|real time|time passing|wait(?:ing)? (?:\d+|hours|days))\b/i;
42
+ const OUTSIDE = /\b(?:stripe|payment (?:provider|processor|gateway)|card (?:network|issuer|authori[sz]ation)|3-?d ?secure|third[- ]party|external (?:service|system|provider|site)|e-?mail|inbox|sms|text message|push notification|google|routing provider|maps? (?:api|provider)|mapbox|tomtom|another app|mobile app|native app|another tab|other tab|second tab|two tabs|iframe|captcha|clock|real time|time passing|wait(?:ing)? (?:\d+|hours|days))\b/i;
43
43
  export const acceptedReason = (why) => OUTSIDE.test(why) && !NOT_A_REASON.some((re) => re.test(why));
44
44
  export function ruleCoverage(content, planned) {
45
45
  const tested = new Set(findTestBlocks(content).flatMap((b) => b.rules));
@@ -53,7 +53,9 @@ export function runnerCommand(config, area, framework, root, rel, journey, targe
53
53
  return `${explicit} ${paths.join(' ')}`;
54
54
  // A custom command still honours --journey: narrow it to that journey's
55
55
  // tests, or `run --journey x` silently runs the whole suite.
56
- return journey ? `${explicit} ${framework === 'playwright' ? `${rel}/${journey}` : `--testPathPattern "${journey}"`}` : explicit;
56
+ // A path argument, not --testPathPattern: Jest 30 renamed that flag, and a
57
+ // path narrows the run the same way in every version of both runners.
58
+ return journey ? `${explicit} ${rel}/${journey}` : explicit;
57
59
  }
58
60
  if (framework === 'playwright') {
59
61
  const target = paths.length
@@ -100,7 +102,7 @@ export function runnerCommand(config, area, framework, root, rel, journey, targe
100
102
  if (paths.length)
101
103
  return `npx jest${jestCfg} ${paths.join(' ')}`;
102
104
  return journey
103
- ? `npx jest${jestCfg} --testPathPattern "${journey}"`
105
+ ? `npx jest${jestCfg} ${rel}/${journey}`
104
106
  : `npx jest${jestCfg} ${rel}`;
105
107
  }
106
108
  export function runTests(opts = {}) {
@@ -133,7 +135,9 @@ export function runTests(opts = {}) {
133
135
  // Tests written before their feature: hold back the files whose names and
134
136
  // pages the code does not have yet, instead of running them to fail.
135
137
  let targets;
136
- if (framework === 'playwright' && !opts.all) {
138
+ // Every runner, not only Playwright: a feature behind a flag, or a name
139
+ // the product has not given, holds an API test back just the same.
140
+ if (!opts.all) {
137
141
  const scope = opts.journey && existsSync(join(testDir, opts.journey)) ? join(testDir, opts.journey) : testDir;
138
142
  const files = testFilesIn(scope).filter((f) => !opts.journey || f.includes(opts.journey));
139
143
  const roots = [sourceRoot(), ...(config.relatedDirs ?? [])];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activate-core/test-forge",
3
- "version": "2.2.0",
3
+ "version": "2.2.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": {