summaryrefslogtreecommitdiff
path: root/test/parallel/test-coverage-with-inspector-disabled.js
diff options
context:
space:
mode:
authorShobhit Chittora <schittora@paypal.com>2019-09-14 05:39:46 +0530
committerAnna Henningsen <anna@addaleax.net>2019-09-23 12:04:20 +0200
commitfdd5d4ad4a228af6e5a7dc74ddf0e03dc5637254 (patch)
treea8c2ad59cd9222a516f3d4314195e41649cb7627 /test/parallel/test-coverage-with-inspector-disabled.js
parent4ef3ccbbe09d2f0cde8da078f9d2543332b152d2 (diff)
downloadandroid-node-v8-fdd5d4ad4a228af6e5a7dc74ddf0e03dc5637254.tar.gz
android-node-v8-fdd5d4ad4a228af6e5a7dc74ddf0e03dc5637254.tar.bz2
android-node-v8-fdd5d4ad4a228af6e5a7dc74ddf0e03dc5637254.zip
bootstrap: add exception handling for profiler bootstrap
Add exception handling for the case when profile is not bootstrapped when coverage is enabled. Fixes: https://github.com/nodejs/node/issues/29542 PR-URL: https://github.com/nodejs/node/pull/29552 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/parallel/test-coverage-with-inspector-disabled.js')
-rw-r--r--test/parallel/test-coverage-with-inspector-disabled.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/parallel/test-coverage-with-inspector-disabled.js b/test/parallel/test-coverage-with-inspector-disabled.js
new file mode 100644
index 0000000000..0b0c2aea43
--- /dev/null
+++ b/test/parallel/test-coverage-with-inspector-disabled.js
@@ -0,0 +1,24 @@
+'use strict';
+
+const common = require('../common');
+common.skipIfInspectorEnabled();
+
+const fixtures = require('../common/fixtures');
+const assert = require('assert');
+const { spawnSync } = require('child_process');
+const env = { ...process.env, NODE_V8_COVERAGE: '/foo/bar' };
+const childPath = fixtures.path('v8-coverage/subprocess');
+const { status, stderr } = spawnSync(
+ process.execPath,
+ [childPath],
+ { env }
+);
+
+const warningMessage = 'The inspector is disabled, ' +
+ 'coverage could not be collected';
+
+assert.strictEqual(status, 0);
+assert.strictEqual(
+ stderr.toString().includes(`Warning: ${warningMessage}`),
+ true
+);