Skip to content

Commit 0bf1040

Browse files
committed
fix: testcase instructions
1 parent cab82a0 commit 0bf1040

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/modules/common/instructions/fix-test-script.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,14 @@ export const fixTestScriptInstructions = `
9595
expect,
9696
};
9797
98-
- fix testcases using above syntax,
99-
- ensure all test cases are valid syntactically,
100-
- dont use any other syntax or return any other text outside of the test cases.
101-
- dont use any markdown or code snippet
102-
- dont wrap output in triple backticks or labels like "javascript", "js", etc.
103-
- Output must be ONLY the raw test cases in javascript format.
98+
- Fix testcases using above syntax,
99+
- Ensure all test cases are valid syntactically,
100+
- Dont use any other syntax or return any other text outside of the test cases.
101+
- Dont use any markdown or code snippet
102+
- Do not wrap the output in markdown, code fences, or labels (e.g., "javascript", "Here are...", etc.).
103+
- The model should return only raw JavaScript test cases in the correct syntax.
104+
- Unnecessary text like "Here are the corrected test cases:" are not required, its breaking the js syntax.
105+
- Dont give any introduction or ending phrase just give only the testcase.
104106
- Example format: '
105107
sp.test("userId is a number", function () {
106108
sp.expect(jsonBody.userId).to.be.a("number");

src/modules/workspace/services/ai-assistant.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,12 +2486,12 @@ export class AiAssistantService {
24862486
{ role: "system", content: fixTestScriptInstructions },
24872487
{
24882488
role: "user",
2489-
content: `Test Script:\n${content.testScript}\n\n`,
2489+
content: `${content.testScript}`,
24902490
},
24912491
],
24922492
},
24932493
});
2494-
2494+
24952495
const output = (
24962496
response.body as any
24972497
).choices?.[0]?.message?.content?.trim();

0 commit comments

Comments
 (0)