@activate-core/test-forge 0.6.0 → 0.6.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/dist/core/ai-generator.js +13 -3
- package/package.json +1 -1
|
@@ -49,6 +49,11 @@ export function buildPrompt(journey, map, testPath, focus, harnessPath) {
|
|
|
49
49
|
const framework = isApi
|
|
50
50
|
? 'Jest (with supertest for HTTP) for an API/backend test'
|
|
51
51
|
: 'Playwright for a web/UI test';
|
|
52
|
+
// Pending-test syntax differs by runner: Jest has test.todo/it.skip;
|
|
53
|
+
// Playwright has NEITHER (test.todo throws) — it uses test.fixme/skip.
|
|
54
|
+
const pending = isApi
|
|
55
|
+
? 'test.todo(...) or it.skip(...)'
|
|
56
|
+
: 'test.fixme(title, async () => {}) or test.skip(title, async () => {}) — Playwright has NO test.todo/it.*';
|
|
52
57
|
const ext = config.testExtension ?? '.test.ts';
|
|
53
58
|
const isJs = ext.endsWith('.js');
|
|
54
59
|
const language = isJs
|
|
@@ -86,7 +91,7 @@ export function buildPrompt(journey, map, testPath, focus, harnessPath) {
|
|
|
86
91
|
`assert that a vulnerability exists when the journey doc EXPLICITLY`,
|
|
87
92
|
`documents it as a known/accepted behavior. If you cannot tell from the`,
|
|
88
93
|
`journey or map whether a defense exists, write the check as`,
|
|
89
|
-
|
|
94
|
+
`${pending} with a "// TODO:" note — never assume a`,
|
|
90
95
|
`guard is missing and produce a failing test that falsely brands the`,
|
|
91
96
|
`product as vulnerable.`,
|
|
92
97
|
``,
|
|
@@ -98,9 +103,9 @@ export function buildPrompt(journey, map, testPath, focus, harnessPath) {
|
|
|
98
103
|
`models it touches. Confirm the REAL endpoint paths, HTTP methods,`,
|
|
99
104
|
`request/response shapes, status codes, auth requirements, and function`,
|
|
100
105
|
`signatures from the code. Base every assertion on what the code`,
|
|
101
|
-
`actually does. Only fall back to
|
|
106
|
+
`actually does. Only fall back to a pending test (${pending}) when`,
|
|
102
107
|
`the behavior genuinely cannot be determined from the source — do not`,
|
|
103
|
-
`leave something
|
|
108
|
+
`leave something pending that a quick read of the code would answer.`,
|
|
104
109
|
`Do NOT write or edit any file; output only the test code to stdout.`,
|
|
105
110
|
``,
|
|
106
111
|
isApi
|
|
@@ -119,6 +124,11 @@ export function buildPrompt(journey, map, testPath, focus, harnessPath) {
|
|
|
119
124
|
`the UI. Use placeholder selectors with a TODO comment where the`,
|
|
120
125
|
`real page structure is unknown — do not invent selectors as if`,
|
|
121
126
|
`they are real.`,
|
|
127
|
+
`CRITICAL Playwright API: import { test, expect } from`,
|
|
128
|
+
`'@playwright/test'. There is NO test.todo / it.* / describe.skip`,
|
|
129
|
+
`in Playwright — using them throws at collection and breaks the`,
|
|
130
|
+
`WHOLE file. For a pending case use test.fixme(title, async () =>`,
|
|
131
|
+
`{}) or test.skip(...); group with test.describe(...).`,
|
|
122
132
|
].join('\n'),
|
|
123
133
|
``,
|
|
124
134
|
...(testPath
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activate-core/test-forge",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.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": {
|