summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortelenord <nordtelecom.yandex.ru>2019-11-06 17:32:13 +0300
committerGireesh Punathil <gpunathi@in.ibm.com>2019-11-24 11:48:28 +0530
commitd90219d9ad6e70b725b030dd750003063df81059 (patch)
tree2454d689561e63d5437bea4fa356d638c564b739 /test
parent5de2afb94e20c330efd4ce23a6fc2da965514429 (diff)
downloadandroid-node-v8-d90219d9ad6e70b725b030dd750003063df81059.tar.gz
android-node-v8-d90219d9ad6e70b725b030dd750003063df81059.tar.bz2
android-node-v8-d90219d9ad6e70b725b030dd750003063df81059.zip
test: test cover cases when trace is empty
cover prepare_stack_trace in case when trace is empty PR-URL: https://github.com/nodejs/node/pull/30311 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/source-map/emptyStackError.js6
-rw-r--r--test/parallel/test-source-map.js12
2 files changed, 18 insertions, 0 deletions
diff --git a/test/fixtures/source-map/emptyStackError.js b/test/fixtures/source-map/emptyStackError.js
new file mode 100644
index 0000000000..b02367a180
--- /dev/null
+++ b/test/fixtures/source-map/emptyStackError.js
@@ -0,0 +1,6 @@
+"use strict";
+
+Error.stackTraceLimit = 0;
+throw new RangeError('emptyStackError');
+
+
diff --git a/test/parallel/test-source-map.js b/test/parallel/test-source-map.js
index c14892890c..7113044143 100644
--- a/test/parallel/test-source-map.js
+++ b/test/parallel/test-source-map.js
@@ -253,6 +253,18 @@ function nextdir() {
}
}
+// trace.length === 0 .
+{
+ const output = spawnSync(process.execPath, [
+ '--enable-source-maps',
+ require.resolve('../fixtures/source-map/emptyStackError.js')
+ ]);
+
+ assert.ok(
+ output.stderr.toString().match('emptyStackError')
+ );
+}
+
function getSourceMapFromCache(fixtureFile, coverageDirectory) {
const jsonFiles = fs.readdirSync(coverageDirectory);
for (const jsonFile of jsonFiles) {