mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-03 18:06:54 +02:00
fix(qa): number the qa value-bar questions from 1 and say reproduced bugs already answer the first two
This commit is contained in:
1 parent
2b76634831
commit
53c5b7505d
3 files changed
+9
-9
No files matched your search
+3
-3
@@ -554,10 +554,10 @@ Preserve the initial charters under **Charters** after that metadata, before fin
|
||||
|
||||
Each proposed test carries a value card; propose it only when it passes this bar:
|
||||
|
||||
**Test value bar.** Before writing the test (the reproduced bug answers what it protects and what makes it fail):
|
||||
**Test value bar.** Before writing or proposing a test, the reproduced bug already answers what it protects and what makes it fail; also answer:
|
||||
|
||||
3. Why does existing coverage not already catch that? Prefer adding a row to an existing table-driven test or shared fixture over a near-duplicate.
|
||||
4. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, test at the real boundary instead.
|
||||
1. Why does existing coverage not already catch that? Prefer adding a row to an existing table-driven test or shared fixture over a near-duplicate.
|
||||
2. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, test at the real boundary instead.
|
||||
|
||||
Value card: `Value: protects=<...>; fails_when=<...>; why_new=<...>; seam=none` (seam: `none` or its name); each field at most 160 UTF-8 bytes here (clamp to 157 plus `...`; JSON keeps full values). Put it in the 8e.5 record (/qa) or under each proposed test (/qa-only). A missing upstream card never blocks: derive it; ignore unknown fields.
|
||||
|
||||
|
||||
+3
-3
@@ -643,10 +643,10 @@ and unclear contracts never authorize repair.
|
||||
|
||||
### 8a.5. Regression test before repair
|
||||
|
||||
**Test value bar.** Before writing the test (the reproduced bug answers what it protects and what makes it fail):
|
||||
**Test value bar.** Before writing or proposing a test, the reproduced bug already answers what it protects and what makes it fail; also answer:
|
||||
|
||||
3. Why does existing coverage not already catch that? Prefer adding a row to an existing table-driven test or shared fixture over a near-duplicate.
|
||||
4. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, test at the real boundary instead.
|
||||
1. Why does existing coverage not already catch that? Prefer adding a row to an existing table-driven test or shared fixture over a near-duplicate.
|
||||
2. Does it need a production seam (export, flag, wrapper, injection hook) that no production caller needs? If yes, test at the real boundary instead.
|
||||
|
||||
Value card: `Value: protects=<...>; fails_when=<...>; why_new=<...>; seam=none` (seam: `none` or its name); each field at most 160 UTF-8 bytes here (clamp to 157 plus `...`; JSON keeps full values). Put it in the 8e.5 record (/qa) or under each proposed test (/qa-only). A missing upstream card never blocks: derive it; ignore unknown fields.
|
||||
|
||||
|
||||
@@ -118,8 +118,8 @@ const EXAMPLE_CARD = renderValueCard({
|
||||
const EXAMPLE_REJECTED = 'Rejected (covered_elsewhere): "checkout renders"; checkout.e2e.ts:15 covers it, so extend that test.';
|
||||
|
||||
function questionList(mode: TestValueBarMode): string {
|
||||
const numbered = QUESTIONS.map((question, index) => `${index + 1}. ${question}`);
|
||||
return mode === 'qa' ? numbered.slice(2).join('\n') : numbered.join('\n');
|
||||
const questions = mode === 'qa' ? QUESTIONS.slice(2) : QUESTIONS;
|
||||
return questions.map((question, index) => `${index + 1}. ${question}`).join('\n');
|
||||
}
|
||||
|
||||
function cardRules(mode: TestValueBarMode): string {
|
||||
@@ -154,7 +154,7 @@ export function generateTestValueBar(_ctx: TemplateContext, args?: string[]): st
|
||||
const mode = args?.[0] as TestValueBarMode;
|
||||
if (!TEST_VALUE_BAR_MODES.includes(mode)) throw new Error(MESSAGES.unknownMode.message.replace('<x>', String(args?.[0])));
|
||||
const parts = [
|
||||
`**Test value bar.** ${mode === 'qa' ? 'Before writing the test (the reproduced bug answers what it protects and what makes it fail):' : 'Propose or write a test only with all four answers; otherwise extend an existing test or drop it:'}`,
|
||||
`**Test value bar.** ${mode === 'qa' ? 'Before writing or proposing a test, the reproduced bug already answers what it protects and what makes it fail; also answer:' : 'Propose or write a test only with all four answers; otherwise extend an existing test or drop it:'}`,
|
||||
questionList(mode),
|
||||
cardRules(mode),
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user