@empiricalrun/test-run 0.10.2 → 0.10.3

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,11 @@
1
1
  # @empiricalrun/test-run
2
2
 
3
+ ## 0.10.3
4
+
5
+ ### Patch Changes
6
+
7
+ - cfb157a: fix: follow-ups for playwright reporter upgrade
8
+
3
9
  ## 0.10.2
4
10
 
5
11
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAY,QAAQ,EAAE,MAAM,SAAS,CAAC;AAO7C,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC;AAEzC,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;;;GAiBA;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;CACjD,CAAC,CAaD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAY,QAAQ,EAAE,MAAM,SAAS,CAAC;AAO7C,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC;AAczC,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;;;GAiBA;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;CACjD,CAAC,CAaD"}
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.spawnCmd = exports.runSpecificTestsCmd = void 0;
7
7
  exports.runSingleTest = runSingleTest;
8
8
  exports.getAllPlaywrightProjects = getAllPlaywrightProjects;
9
- const promises_1 = __importDefault(require("fs/promises"));
9
+ const fs_1 = __importDefault(require("fs"));
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const cmd_1 = require("./lib/cmd");
12
12
  Object.defineProperty(exports, "spawnCmd", { enumerable: true, get: function () { return cmd_1.spawnCmd; } });
@@ -18,6 +18,13 @@ const utils_1 = require("./utils");
18
18
  // For test-run package, the library entrypoint, we only support web platform
19
19
  // The bin entrypoint has support for mobile also
20
20
  const supportedPlatform = types_1.Platform.WEB;
21
+ function getSummaryJsonPath(repoDir) {
22
+ const pathForPlaywright147 = path_1.default.join(repoDir, "playwright-report", "summary.json");
23
+ const pathForOtherPlaywrightVersions = path_1.default.join(repoDir, "summary.json");
24
+ return fs_1.default.existsSync(pathForPlaywright147)
25
+ ? pathForPlaywright147
26
+ : pathForOtherPlaywrightVersions;
27
+ }
21
28
  async function runSingleTest({ testName, suites, filePath, projects, envOverrides, repoDir, }) {
22
29
  const testDir = "tests";
23
30
  const commandToRun = await (0, run_specific_test_1.runSpecificTestsCmd)({
@@ -28,8 +35,8 @@ async function runSingleTest({ testName, suites, filePath, projects, envOverride
28
35
  repoDir,
29
36
  });
30
37
  const { hasTestPassed } = await (0, cmd_1.runTestsForCmd)(commandToRun, repoDir);
31
- const jsonFilePath = path_1.default.join(repoDir, "playwright-report", `summary.json`);
32
- const jsonFileContents = await promises_1.default.readFile(jsonFilePath, "utf8");
38
+ const jsonFilePath = getSummaryJsonPath(repoDir);
39
+ const jsonFileContents = fs_1.default.readFileSync(jsonFilePath, "utf8");
33
40
  const summaryJson = JSON.parse(jsonFileContents);
34
41
  return {
35
42
  hasTestPassed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-run",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"