Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

refactor: replace deprecated 'String.prototype.substr()' (#4852)

CommanderRoota81613070ceb
diff --git a/lib/reporters/html.js b/lib/reporters/html.js
index f0fb538a..034fb07f 100644
--- a/lib/reporters/html.js
+++ b/lib/reporters/html.js
@@ -181,7 +181,7 @@ function HTML(runner, options) {
if (indexOfMessage === -1) {
stackString = test.err.stack;
} else {
- stackString = test.err.stack.substr(
+ stackString = test.err.stack.slice(
test.err.message.length + indexOfMessage
);
}