@brillout/test-e2e 0.5.6 → 0.5.7

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.
Files changed (2) hide show
  1. package/dist/runAll.js +9 -4
  2. package/package.json +1 -1
package/dist/runAll.js CHANGED
@@ -17,14 +17,19 @@ async function runAll(filter) {
17
17
  await (0, getConfig_1.loadConfig)();
18
18
  const testFiles = await (0, findTestFiles_1.findTestFiles)(filter);
19
19
  const browser = await (0, getBrowser_1.getBrowser)();
20
- const hasFailedTestFile = await runTestFiles(testFiles, browser);
20
+ const failedTestFiles = await runTestFiles(testFiles, browser);
21
21
  await browser.close();
22
+ const hasFailedTestFile = failedTestFiles.length > 0;
22
23
  const hasFailLog = (0, logTestStatus_1.hasFail)();
23
24
  if (hasFailedTestFile || hasFailLog) {
24
25
  // hasFailedTestFile and hasFailLog are redundant
25
26
  // - When assert.ts calls logFail() this code block isn't run
26
27
  (0, utils_1.assert)(hasFailedTestFile && hasFailLog);
27
- throw new Error('Following tests failed, see logs above for more information.');
28
+ (0, utils_1.assert)(failedTestFiles.length > 0);
29
+ throw new Error([
30
+ 'Following test files failed, see all the logs printed above for more information.',
31
+ ...failedTestFiles.map((testFile) => ` ${testFile}`),
32
+ ].join('\n'));
28
33
  }
29
34
  }
30
35
  exports.runAll = runAll;
@@ -37,7 +42,7 @@ async function runTestFiles(testFiles, browser) {
37
42
  }
38
43
  }
39
44
  if (!(0, utils_1.isCI)()) {
40
- return failedFirstAttempt.length > 0;
45
+ return failedFirstAttempt;
41
46
  }
42
47
  const failedSecondAttempt = [];
43
48
  for (const testFile of failedFirstAttempt) {
@@ -46,7 +51,7 @@ async function runTestFiles(testFiles, browser) {
46
51
  failedSecondAttempt.push(testFile);
47
52
  }
48
53
  }
49
- return failedSecondAttempt.length > 0;
54
+ return failedSecondAttempt;
50
55
  }
51
56
  async function buildAndTest(testFile, browser, isSecondAttempt) {
52
57
  (0, utils_1.assert)(testFile.endsWith('.ts'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {