@brillout/test-e2e 0.6.1 → 0.6.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.
Files changed (2) hide show
  1. package/dist/Logs.js +5 -4
  2. package/package.json +1 -1
package/dist/Logs.js CHANGED
@@ -87,7 +87,7 @@ function add({ logSource, logText, loggedAfterExit = false, }) {
87
87
  */
88
88
  function expectLog(logText, { filter: logFilter, allLogs } = {}) {
89
89
  const logList = allLogs ? logEntriesAll : logEntries;
90
- let logsFound = logList.filter((logEntry) => {
90
+ const logsFound = logList.filter((logEntry) => {
91
91
  if (removeAnsi(logEntry).logText.includes(logText)) {
92
92
  logEntry.isNotFailure = true;
93
93
  return true;
@@ -99,9 +99,10 @@ function expectLog(logText, { filter: logFilter, allLogs } = {}) {
99
99
  }
100
100
  if (!logFilter)
101
101
  return;
102
- logsFound = logsFound.filter((logEntry) => logFilter(removeAnsi(logEntry)));
103
- if (logsFound.length === 0) {
104
- throw new Error(`The following log was logged as expected, but it didn't match the logFilter() you provided: "${logText}"`);
102
+ const logsFoundAfterFilter = logsFound.filter((logEntry) => logFilter(removeAnsi(logEntry)));
103
+ if (logsFoundAfterFilter.length === 0) {
104
+ console.log(JSON.stringify(logsFound, null, 2));
105
+ throw new Error(`Logs above are matching "${logText}" but don't match the filter you provided.`);
105
106
  }
106
107
  }
107
108
  function removeAnsi(logEntry) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/test-e2e",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "bin": "./bin.js",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",