@brillout/test-e2e 0.5.4 → 0.5.5

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.
@@ -2,7 +2,6 @@ export { getConfig };
2
2
  export { loadConfig };
3
3
  declare type Config = {
4
4
  tolerateError?: Function;
5
- tolerateSkip?: boolean;
6
5
  ci?: never;
7
6
  };
8
7
  declare function getConfig(): Config;
package/dist/getConfig.js CHANGED
@@ -30,9 +30,6 @@ function assertConfig(config) {
30
30
  if (key === 'tolerateError') {
31
31
  (0, utils_1.assertUsage)((0, utils_1.isCallable)(val), `${wrongType} function`);
32
32
  }
33
- else if (key === 'tolerateSkip') {
34
- (0, utils_1.assertUsage)(typeof val === 'boolean', `${wrongType} boolean`);
35
- }
36
33
  else if (key === 'ci') {
37
34
  // Only used by .github/workflows/ci/getTestJobs.mjs
38
35
  // https://github.com/brillout/vite-plugin-ssr/blob/4fa329e4081655c39c4c70436ae73e563489439e/.github/workflows/ci/getTestJobs.mjs#L72
@@ -23,7 +23,9 @@ declare type TestInfo = {
23
23
  isFlaky: boolean;
24
24
  };
25
25
  hasStartedRunning?: boolean;
26
- skipped?: string;
26
+ skipped?: {
27
+ reason: string;
28
+ };
27
29
  startServer?: () => Promise<void>;
28
30
  terminateServer?: () => Promise<void>;
29
31
  afterEach?: (hasFailed: boolean) => void;
package/dist/runAll.js CHANGED
@@ -63,7 +63,7 @@ async function runServerAndTests(browser, isSecondAttempt) {
63
63
  // Set when user calls `skip()`
64
64
  if (testInfo.skipped) {
65
65
  assertSkipUsage(testInfo);
66
- (0, logTestStatus_1.logWarn)(testInfo.skipped);
66
+ (0, logTestStatus_1.logWarn)(testInfo.skipped.reason);
67
67
  return true;
68
68
  }
69
69
  // Set when user calls `run()`
@@ -191,6 +191,7 @@ function runTest(testFn, testFunctionTimeout) {
191
191
  return promise;
192
192
  }
193
193
  function assertSkipUsage(testInfo) {
194
+ (0, utils_1.assert)(testInfo.skipped);
194
195
  {
195
196
  const err = 'You cannot call run() after calling skip()';
196
197
  (0, utils_1.assertUsage)(testInfo.runInfo === undefined, err);
@@ -199,13 +200,4 @@ function assertSkipUsage(testInfo) {
199
200
  const err = 'You cannot call test() after calling skip()';
200
201
  (0, utils_1.assertUsage)(testInfo.tests === undefined, err);
201
202
  }
202
- const config = (0, getConfig_1.getConfig)();
203
- {
204
- const err = 'Using skip() while config tolerateSkip is set to false';
205
- (0, utils_1.assertUsage)(config.tolerateSkip !== false, err);
206
- }
207
- {
208
- const err = 'Using skip() while config tolerateSkip is set to undefined and tests are running in a parallel CI';
209
- (0, utils_1.assertUsage)(!(config.tolerateSkip === undefined && (0, parallel_ci_1.isParallelCI)()), err);
210
- }
211
203
  }
package/dist/setup.js CHANGED
@@ -31,7 +31,7 @@ const TIMEOUT_AUTORETRY = TIMEOUT_TEST_FUNCTION / 2;
31
31
  const TIMEOUT_PLAYWRIGHT = TIMEOUT_TEST_FUNCTION / 2;
32
32
  function skip(reason) {
33
33
  const testInfo = (0, getCurrentTest_1.getCurrentTest)();
34
- testInfo.skipped = reason;
34
+ testInfo.skipped = { reason };
35
35
  }
36
36
  exports.skip = skip;
37
37
  function run(cmd, {
@@ -81,7 +81,7 @@ function logDebugInfo() {
81
81
  (0, logSection_1.logSection)('DEBUG INFO');
82
82
  const testInfo = (0, getCurrentTest_1.getCurrentTest)();
83
83
  console.log('testInfo.hasStartedRunning', testInfo.hasStartedRunning);
84
- console.log('testInfo.skipped', testInfo.skipped);
84
+ console.log('testInfo.skipped?.reason', testInfo.skipped?.reason);
85
85
  console.log('testInfo.runInfo', testInfo.runInfo);
86
86
  console.log('testInfo.testFile', testInfo.testFile);
87
87
  console.log('testInfo.testName', testInfo.testName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {