@empiricalrun/test-gen 0.38.36 → 0.38.37
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-flow.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/update-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAiB3B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,KAAK,eAAe,GAAG,QAAQ,GAAG;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"update-flow.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/update-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAiB3B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,KAAK,eAAe,GAAG,QAAQ,GAAG;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA2IF,wBAAsB,2BAA2B,CAAC,EAChD,QAAQ,EACR,eAAe,EACf,SAAS,EACT,SAAS,EACT,YAAY,EACZ,KAAK,EACL,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,GAAG,OAAO,CACT;IACE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,EAAE,CACJ,CA+CA;AAED,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAAG,SAAS,EACzC,OAAO,GAAE,OAAc,EACvB,QAAQ,GAAE,OAAc,EACxB,KAAK,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,EAAE,CAAC,CA4D5B;AAED,wBAAsB,kCAAkC,CAAC,EACvD,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,KAAK,GACN,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;CACtB,mBAuGA;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAoB,GACrB,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA4C7B"}
|
|
@@ -81,7 +81,12 @@ async function applyFileChanges({ validateTypes = true, trace, testCase, fileCha
|
|
|
81
81
|
// since we dont know what is getting updated,
|
|
82
82
|
// we believe that the patch is correct and contains few before and after lines
|
|
83
83
|
// to make the change unique for search & replace
|
|
84
|
-
|
|
84
|
+
if (contents.includes(fileChange.oldCode)) {
|
|
85
|
+
contents = contents.replace(fileChange.oldCode, `\n\n${fileChange.newCode}`);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
logger.error(`Unable to find the code to update in ${fileChange.filePath}`);
|
|
89
|
+
}
|
|
85
90
|
}
|
|
86
91
|
await fs_extra_1.default.writeFile(fileChange.filePath, contents, "utf-8");
|
|
87
92
|
readWriteFileSpan?.end({ output: { contents } });
|
|
@@ -194,7 +199,7 @@ async function updateTest(testCase, file, options, logging = true, validate = tr
|
|
|
194
199
|
nonSpecFilePrompt: nonSpecFilePrompt,
|
|
195
200
|
});
|
|
196
201
|
if (trace) {
|
|
197
|
-
logger.log(`
|
|
202
|
+
logger.log(`View [trace](${trace.getTraceUrl()})`);
|
|
198
203
|
}
|
|
199
204
|
generatedTestCases.push({
|
|
200
205
|
...testCase,
|
|
@@ -332,7 +337,7 @@ async function appendCreateTestBlock({ testCase, file, options, trace, validateT
|
|
|
332
337
|
validateTypes,
|
|
333
338
|
});
|
|
334
339
|
if (trace) {
|
|
335
|
-
logger.log(`
|
|
340
|
+
logger.log(`View [trace](${trace.getTraceUrl()})`);
|
|
336
341
|
}
|
|
337
342
|
generatedTestCases.push({
|
|
338
343
|
...testCase,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.37",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"ts-morph": "^24.0.0",
|
|
72
72
|
"tsx": "^4.16.2",
|
|
73
73
|
"typescript": "^5.3.3",
|
|
74
|
-
"@empiricalrun/llm": "^0.9.28",
|
|
75
74
|
"@empiricalrun/r2-uploader": "^0.3.7",
|
|
76
|
-
"@empiricalrun/reporter": "^0.21.4"
|
|
75
|
+
"@empiricalrun/reporter": "^0.21.4",
|
|
76
|
+
"@empiricalrun/llm": "^0.9.28"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@types/detect-port": "^1.3.5",
|