@empiricalrun/test-gen 0.28.3 → 0.28.4
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/CHANGELOG.md +6 -0
- package/dist/agent/codegen/run.js +1 -1
- package/dist/agent/codegen/update-flow.js +2 -2
- package/package.json +3 -3
- package/vitest.config.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -77,7 +77,7 @@ async function generateTest(testCase, file, options) {
|
|
|
77
77
|
logger.success("Test generated successfully!");
|
|
78
78
|
const readWriteFileSpan = trace.span({ name: "write-to-file" });
|
|
79
79
|
let contents = fs_extra_1.default.readFileSync(file, "utf-8");
|
|
80
|
-
const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(response, testCase?.name,
|
|
80
|
+
const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(response, testCase?.name, []);
|
|
81
81
|
let updatedContent = prependContent + contents + `\n\n${strippedContent}`;
|
|
82
82
|
await fs_extra_1.default.writeFile(file, updatedContent, "utf-8");
|
|
83
83
|
readWriteFileSpan.end({ output: { updatedContent } });
|
|
@@ -23,14 +23,14 @@ async function applyFileChanges({ validateTypes = true, trace, testCase, fileCha
|
|
|
23
23
|
const { testBlock: testBlockUpdate } = (0, web_1.getTypescriptTestBlock)({
|
|
24
24
|
scenarioName: testCase?.name || "",
|
|
25
25
|
content: fileChange.newCode || "",
|
|
26
|
-
suites:
|
|
26
|
+
suites: [], // suites should be empty here since we ask LLM to send immediate parent AST node for the code update. so there won't be any nesting here, just the test block
|
|
27
27
|
});
|
|
28
28
|
if (testBlockUpdate) {
|
|
29
29
|
// assuming the test case getting updated
|
|
30
30
|
// maintaining the previous accuracy of the test case update
|
|
31
31
|
const readWriteFileSpan = trace.span({ name: "write-to-file" });
|
|
32
32
|
let contents = await fs_extra_1.default.readFile(fileChange.filePath, "utf-8");
|
|
33
|
-
const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(fileChange.newCode, testCase?.name,
|
|
33
|
+
const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(fileChange.newCode, testCase?.name, []);
|
|
34
34
|
let updatedContent = prependContent + contents + `\n\n${strippedContent}`;
|
|
35
35
|
const { testBlock } = (0, web_1.getTypescriptTestBlock)({
|
|
36
36
|
scenarioName: testCase?.name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"tsx": "^4.16.2",
|
|
45
45
|
"typescript": "^5.3.3",
|
|
46
46
|
"@empiricalrun/r2-uploader": "^0.3.0",
|
|
47
|
-
"@empiricalrun/
|
|
48
|
-
"@empiricalrun/
|
|
47
|
+
"@empiricalrun/llm": "^0.9.2",
|
|
48
|
+
"@empiricalrun/reporter": "^0.18.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/detect-port": "^1.3.5",
|
package/vitest.config.ts
ADDED