@activate-core/test-forge 0.18.9 → 0.18.10
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/package.json +1 -1
- package/dist/core/coverage.js +0 -54
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activate-core/test-forge",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.10",
|
|
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": {
|
package/dist/core/coverage.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* testforge — the coverage manifest.
|
|
3
|
-
*
|
|
4
|
-
* A green run is only meaningful if the count behind it is honest, so this
|
|
5
|
-
* records REAL files (they assert something) apart from DEFERRED ones (they
|
|
6
|
-
* are pending placeholders). Without the split, a suite of placeholders reads
|
|
7
|
-
* as full coverage.
|
|
8
|
-
*/
|
|
9
|
-
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
10
|
-
import { analyzeFile } from './validate.js';
|
|
11
|
-
import { COVERAGE_PATH, STATE_DIR } from './paths.js';
|
|
12
|
-
/**
|
|
13
|
-
* F8 — write an honest coverage manifest. For every generated file it
|
|
14
|
-
* records real (has assertions) vs deferred (pending only), so a "green"
|
|
15
|
-
* run is never mistaken for full coverage. Written to
|
|
16
|
-
* test-artifacts/coverage.json and summarised to the console.
|
|
17
|
-
*/
|
|
18
|
-
export function writeCoverageManifest(results) {
|
|
19
|
-
const journeys = results
|
|
20
|
-
.filter((r) => r.testFiles.length)
|
|
21
|
-
.map((r) => {
|
|
22
|
-
const files = r.testFiles.map((t) => {
|
|
23
|
-
let a = { activeTests: 0, pending: 0, assertions: 0, real: false };
|
|
24
|
-
try {
|
|
25
|
-
a = analyzeFile(readFileSync(t.path, 'utf-8'));
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
/* file unreadable — count as empty */
|
|
29
|
-
}
|
|
30
|
-
return { file: t.path, status: t.status, ...a };
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
journey: r.journeyName,
|
|
34
|
-
real: files.filter((f) => f.real).length,
|
|
35
|
-
deferred: files.filter((f) => !f.real).length,
|
|
36
|
-
files,
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
if (!journeys.length)
|
|
40
|
-
return;
|
|
41
|
-
const totalReal = journeys.reduce((n, j) => n + j.real, 0);
|
|
42
|
-
const totalDeferred = journeys.reduce((n, j) => n + j.deferred, 0);
|
|
43
|
-
try {
|
|
44
|
-
mkdirSync(STATE_DIR, { recursive: true });
|
|
45
|
-
writeFileSync(COVERAGE_PATH, JSON.stringify({ real: totalReal, deferred: totalDeferred, journeys }, null, 2), 'utf-8');
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
/* best-effort */
|
|
49
|
-
}
|
|
50
|
-
console.log(`\nCoverage: ${totalReal} real test file(s), ${totalDeferred} deferred/placeholder — see ${COVERAGE_PATH}`);
|
|
51
|
-
if (totalDeferred) {
|
|
52
|
-
console.log(` (deferred files are pending, NOT real coverage — regenerate or implement them.)`);
|
|
53
|
-
}
|
|
54
|
-
}
|