@empiricalrun/test-gen 0.10.0 → 0.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - dbacd41: chore: browsing agent should bubble up exit on error
8
+ - 7b7d1fe: chore: remove redundant try-catch from browsing agent
9
+
3
10
  ## 0.10.0
4
11
 
5
12
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/run.ts"],"names":[],"mappings":"AAOA,wBAAsB,+BAA+B,CAAC,YAAY,EAAE,MAAM,iBAwBzE"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/run.ts"],"names":[],"mappings":"AAOA,wBAAsB,+BAA+B,CAAC,YAAY,EAAE,MAAM,iBAsBzE"}
@@ -14,25 +14,22 @@ async function generateTestsUsingBrowsingAgent(testFilePath) {
14
14
  const port = await (0, detect_port_1.default)(3030);
15
15
  const fileService = new server_1.FileService({ port });
16
16
  await fileService.startFileService();
17
- try {
18
- fileService.setFilePath(testFilePath);
19
- //TODO: change this to per test
20
- //TODO: support multiple projects (browsers)
21
- const command = [`npx`, `playwright`, `test`, testFilePath];
22
- if (!process.env.CI) {
23
- command.push(`--headed`);
24
- }
25
- await (0, exec_1.cmd)(command, {
26
- env: {
27
- APP_PORT: port.toString(),
28
- PW_TEST_HTML_REPORT_OPEN: "never",
29
- },
30
- });
31
- await (0, web_1.removeTestOnly)(testFilePath);
17
+ fileService.setFilePath(testFilePath);
18
+ //TODO: change this to per test
19
+ //TODO: support multiple projects (browsers)
20
+ let command = `npx playwright test ${testFilePath} --retries 0`;
21
+ if (!process.env.CI) {
22
+ command = command.concat(` --headed`);
32
23
  }
33
- catch (e) {
34
- // TODO: better error handling -- e.g. undo preparation work
35
- console.error(e);
24
+ const exitCode = await (0, exec_1.cmd)(command.split(" "), {
25
+ env: {
26
+ APP_PORT: port.toString(),
27
+ PW_TEST_HTML_REPORT_OPEN: "never",
28
+ },
29
+ });
30
+ if (exitCode != 0) {
31
+ process.exit(exitCode);
36
32
  }
33
+ await (0, web_1.removeTestOnly)(testFilePath);
37
34
  }
38
35
  exports.generateTestsUsingBrowsingAgent = generateTestsUsingBrowsingAgent;
@@ -1,4 +1,4 @@
1
1
  export declare function cmd(command: string[], options: {
2
2
  env?: Record<string, string>;
3
- }): Promise<string | number>;
3
+ }): Promise<number>;
4
4
  //# sourceMappingURL=exec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/utils/exec.ts"],"names":[],"mappings":"AAGA,wBAAgB,GAAG,CACjB,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACxC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAe1B"}
1
+ {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/utils/exec.ts"],"names":[],"mappings":"AAGA,wBAAgB,GAAG,CACjB,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACxC,OAAO,CAAC,MAAM,CAAC,CAejB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"