@brillout/test-e2e 0.5.0 → 0.5.2

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.
@@ -3,6 +3,7 @@ export { loadConfig };
3
3
  declare type Config = {
4
4
  tolerateError?: Function;
5
5
  tolerateSkip?: boolean;
6
+ ci?: never;
6
7
  };
7
8
  declare function getConfig(): Config;
8
9
  declare function loadConfig(): Promise<void>;
package/dist/getConfig.js CHANGED
@@ -33,6 +33,11 @@ function assertConfig(config) {
33
33
  else if (key === 'tolerateSkip') {
34
34
  (0, utils_1.assertUsage)(typeof val === 'boolean', `${wrongType} boolean`);
35
35
  }
36
+ else if (key === 'ci') {
37
+ // Only used by .github/workflows/ci/getTestJobs.mjs
38
+ // https://github.com/brillout/vite-plugin-ssr/blob/4fa329e4081655c39c4c70436ae73e563489439e/.github/workflows/ci/getTestJobs.mjs#L72
39
+ return;
40
+ }
36
41
  else {
37
42
  (0, utils_1.assertUsage)(false, `${configFileName} unknown config ${key}`);
38
43
  }
@@ -1,6 +1,4 @@
1
1
  export { isParallelCI };
2
- export { abortIfParallelCI };
3
2
  export { getTestFilesForCurrentJob };
4
- declare function abortIfParallelCI(): void;
5
3
  declare function isParallelCI(): boolean;
6
4
  declare function getTestFilesForCurrentJob(): null | string[];
@@ -3,17 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getTestFilesForCurrentJob = exports.abortIfParallelCI = exports.isParallelCI = void 0;
6
+ exports.getTestFilesForCurrentJob = exports.isParallelCI = void 0;
7
7
  const utils_1 = require("./utils");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const cwd = process.cwd();
11
- function abortIfParallelCI() {
12
- if (isParallelCI()) {
13
- process.exit(1);
14
- }
15
- }
16
- exports.abortIfParallelCI = abortIfParallelCI;
17
11
  function isParallelCI() {
18
12
  return getTestFilesForCurrentJob() !== null;
19
13
  }
package/dist/runAll.js CHANGED
@@ -71,6 +71,11 @@ async function runServerAndTests(browser, isSecondAttempt) {
71
71
  (0, utils_1.assert)(testInfo.startServer);
72
72
  (0, utils_1.assert)(testInfo.terminateServer);
73
73
  const isFinalAttempt = isSecondAttempt || !testInfo.runInfo.isFlaky;
74
+ const abortMaybe = () => {
75
+ if (isFinalAttempt && (0, parallel_ci_1.isParallelCI)()) {
76
+ process.exit(1);
77
+ }
78
+ };
74
79
  const page = await browser.newPage();
75
80
  testInfo.page = page;
76
81
  try {
@@ -78,6 +83,7 @@ async function runServerAndTests(browser, isSecondAttempt) {
78
83
  }
79
84
  catch (err) {
80
85
  logFailure(err, 'an error occurred while starting the server', isFinalAttempt);
86
+ abortMaybe();
81
87
  return false;
82
88
  }
83
89
  let success = await runTests(testInfo, isFinalAttempt);
@@ -93,11 +99,12 @@ async function runServerAndTests(browser, isSecondAttempt) {
93
99
  success = false;
94
100
  }
95
101
  }
96
- if (!success && !testInfo.runInfo.isFlaky)
97
- (0, parallel_ci_1.abortIfParallelCI)();
98
102
  if (success) {
99
103
  (0, logTestStatus_1.logPass)();
100
104
  }
105
+ else {
106
+ abortMaybe();
107
+ }
101
108
  Logs_1.Logs.clearLogs();
102
109
  return success;
103
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {