Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(testrunner): fix stack formatting

Andrey Lushnikov5d47a38c1847
diff --git a/utils/testrunner/Reporter.js b/utils/testrunner/Reporter.js
index 5e079ff4fe..4bc59beb10 100644
--- a/utils/testrunner/Reporter.js
+++ b/utils/testrunner/Reporter.js
@@ -181,7 +181,9 @@ class Reporter {
return stack;
const line = lines[index];
const fromIndex = line.lastIndexOf(this._projectFolder) + this._projectFolder.length;
- const toIndex = line.lastIndexOf(')');
+ let toIndex = line.lastIndexOf(')');
+ if (toIndex === -1)
+ toIndex = line.length;
lines[index] = line.substring(0, fromIndex) + YELLOW_COLOR + line.substring(fromIndex, toIndex) + RESET_COLOR + line.substring(toIndex);
return lines.join('\n');
}