@brillout/test-e2e 0.4.15 → 0.4.17

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 -9
  2. package/package.json +1 -1
package/dist/runAll.js CHANGED
@@ -60,11 +60,20 @@ async function buildAndTest(testFile, browser, isSecondAttempt) {
60
60
  }
61
61
  async function runServerAndTests(browser, isSecondAttempt) {
62
62
  const testInfo = (0, getCurrentTest_1.getCurrentTest)();
63
+ // Set when user calls `skip()`
64
+ if (testInfo.skipped) {
65
+ (0, logTestStatus_1.logWarn)(testInfo.skipped);
66
+ (0, utils_1.assertUsage)(!testInfo.runInfo, 'You cannot call `run()` after calling `skip()`');
67
+ (0, utils_1.assertUsage)(testInfo.tests === undefined, 'You cannot call `test()` after calling `skip()`');
68
+ return true;
69
+ }
63
70
  // Set when user calls `run()`
64
71
  (0, utils_1.assert)(testInfo.runInfo);
65
72
  (0, utils_1.assert)(testInfo.startServer);
66
73
  (0, utils_1.assert)(testInfo.terminateServer);
67
74
  const isFinalAttempt = isSecondAttempt || !testInfo.runInfo.isFlaky;
75
+ const page = await browser.newPage();
76
+ testInfo.page = page;
68
77
  try {
69
78
  await testInfo.startServer();
70
79
  }
@@ -72,8 +81,6 @@ async function runServerAndTests(browser, isSecondAttempt) {
72
81
  logFailure(err, 'an error occurred while starting the server', isFinalAttempt);
73
82
  return false;
74
83
  }
75
- const page = await browser.newPage();
76
- testInfo.page = page;
77
84
  let success = await runTests(testInfo, isFinalAttempt);
78
85
  await testInfo.terminateServer();
79
86
  await page.close();
@@ -100,13 +107,6 @@ async function runTests(testInfo, isFinalAttempt) {
100
107
  console.log();
101
108
  console.log(testInfo.testFile);
102
109
  }
103
- // Set when user calls `skip()`
104
- if (testInfo.skipped) {
105
- (0, logTestStatus_1.logWarn)(testInfo.skipped);
106
- (0, utils_1.assertUsage)(!testInfo.runInfo, 'You cannot call `run()` after calling `skip()`');
107
- (0, utils_1.assertUsage)(testInfo.tests === undefined, 'You cannot call `test()` after calling `skip()`');
108
- return true;
109
- }
110
110
  // Set when user calls `run()`
111
111
  (0, utils_1.assert)(testInfo.runInfo);
112
112
  (0, utils_1.assert)(testInfo.afterEach);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {