aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ava/lib/extract-stack.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ava/lib/extract-stack.js')
-rw-r--r--node_modules/ava/lib/extract-stack.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/node_modules/ava/lib/extract-stack.js b/node_modules/ava/lib/extract-stack.js
new file mode 100644
index 000000000..64f63db1c
--- /dev/null
+++ b/node_modules/ava/lib/extract-stack.js
@@ -0,0 +1,10 @@
+'use strict';
+const stackLineRegex = /^.+ \(.+:[0-9]+:[0-9]+\)$/;
+
+module.exports = stack => {
+ return stack
+ .split('\n')
+ .filter(line => stackLineRegex.test(line))
+ .map(line => line.trim())
+ .join('\n');
+};