@brillout/test-e2e 0.1.14 → 0.1.15

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/dist/Logs.d.ts CHANGED
@@ -13,7 +13,7 @@ declare type LogEntry = {
13
13
  logTimestamp: string;
14
14
  isExpectedError: boolean;
15
15
  };
16
- declare function hasError(): boolean;
16
+ declare function hasError(onlyFailOnBrowserError: boolean): boolean;
17
17
  declare function clear(): void;
18
18
  declare function flush(): void;
19
19
  declare function add({ logSource, logText }: {
package/dist/Logs.js CHANGED
@@ -16,8 +16,19 @@ const picocolors_1 = __importDefault(require("picocolors"));
16
16
  const getCurrentTest_1 = require("./getCurrentTest");
17
17
  let logEntries = [];
18
18
  let logEntriesNotPrinted = [];
19
- function hasError() {
20
- const logErrors = logEntries.filter(({ logSource, isExpectedError }) => (logSource === 'Browser Error' || logSource === 'Browser Warning' || logSource === 'stderr') && !isExpectedError);
19
+ function hasError(onlyFailOnBrowserError) {
20
+ const logErrors = logEntries.filter(({ logSource, isExpectedError }) => {
21
+ if (isExpectedError) {
22
+ return;
23
+ }
24
+ if (!onlyFailOnBrowserError && (logSource === 'Browser Warning' || logSource === 'stderr')) {
25
+ return true;
26
+ }
27
+ if (logSource === 'Browser Error') {
28
+ return true;
29
+ }
30
+ return false;
31
+ });
21
32
  return logErrors.length > 0;
22
33
  }
23
34
  function clear() {
@@ -1,4 +1,3 @@
1
- /// <reference types="chai-subset" />
2
1
  export type { ChaiPlugin };
3
2
  export type { Expect };
4
3
  import type { use as chaiUse } from 'chai';
@@ -17,6 +17,7 @@ declare type TestInfo = {
17
17
  serverIsReadyMessage?: string;
18
18
  serverIsReadyDelay: number;
19
19
  inspect: boolean;
20
+ onlyFailOnBrowserError: boolean;
20
21
  };
21
22
  hasStartedRunning?: boolean;
22
23
  skipped?: string;
package/dist/runTests.js CHANGED
@@ -52,7 +52,7 @@ async function runTests(browser) {
52
52
  }
53
53
  done(!!err);
54
54
  testInfo.afterEach(!!err);
55
- const hasErrorLog = Logs_1.Logs.hasError();
55
+ const hasErrorLog = Logs_1.Logs.hasError(testInfo.runInfo.onlyFailOnBrowserError);
56
56
  const isFailure = err || hasErrorLog;
57
57
  if (isFailure) {
58
58
  logTestsResult(false);
package/dist/setup.d.ts CHANGED
@@ -17,12 +17,13 @@ export declare let urlBase: string;
17
17
  export declare const urlBaseChange: (url: string) => string;
18
18
  export { editFile, editFileRevert } from './editFile';
19
19
  declare function skip(reason: string): void;
20
- declare function run(cmd: string, { additionalTimeout, serverIsReadyMessage, serverIsReadyDelay, inspect, cwd, }?: {
20
+ declare function run(cmd: string, { additionalTimeout, serverIsReadyMessage, serverIsReadyDelay, inspect, cwd, onlyFailOnBrowserError, }?: {
21
21
  additionalTimeout?: number;
22
22
  serverIsReadyMessage?: string;
23
23
  serverIsReadyDelay?: number;
24
24
  inspect?: boolean;
25
25
  cwd?: string;
26
+ onlyFailOnBrowserError?: boolean;
26
27
  }): void;
27
28
  declare function autoRetry(test: () => void | Promise<void>, { timeout }?: {
28
29
  timeout?: number;
package/dist/setup.js CHANGED
@@ -37,7 +37,7 @@ function skip(reason) {
37
37
  exports.skip = skip;
38
38
  function run(cmd, {
39
39
  //baseUrl = '',
40
- additionalTimeout = 0, serverIsReadyMessage, serverIsReadyDelay = 1000, inspect = utils_1.cliConfig.inspect, cwd, } = {}) {
40
+ additionalTimeout = 0, serverIsReadyMessage, serverIsReadyDelay = 1000, inspect = utils_1.cliConfig.inspect, cwd, onlyFailOnBrowserError = false, } = {}) {
41
41
  additionalTimeout += serverIsReadyDelay;
42
42
  const testInfo = (0, getCurrentTest_1.getCurrentTest)();
43
43
  testInfo.runInfo = {
@@ -48,6 +48,7 @@ additionalTimeout = 0, serverIsReadyMessage, serverIsReadyDelay = 1000, inspect
48
48
  serverIsReadyMessage,
49
49
  serverIsReadyDelay,
50
50
  inspect,
51
+ onlyFailOnBrowserError,
51
52
  };
52
53
  if (inspect) {
53
54
  Logs_1.Logs.flushEagerly = true;
@@ -1 +1,2 @@
1
- export declare function humanizeTime(milliseconds: number): string;
1
+ export { humanizeTime };
2
+ declare function humanizeTime(milliseconds: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {