The Wayback Machine - https://web.archive.org/web/20220319223850/https://github.com/nodejs/node/commit/733233d3ea
Skip to content
Permalink
Browse files
test: add uncaught exception test for debugger
PR-URL: #8087
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and MylesBorins committed Oct 26, 2016
1 parent c9af24d commit 733233d3ea73ced1a9adf0cefee67483a28dc2f0
Showing with 33 additions and 0 deletions.
  1. +16 −0 test/fixtures/debug-uncaught.js
  2. +17 −0 test/parallel/test-debug-uncaught-exception.js
@@ -0,0 +1,16 @@
'use strict';

require('../common');
const assert = require('assert');
const debug = require('_debugger');

function emit() {
const error = new Error('sterrance');
process.emit('uncaughtException', error);
}

assert.doesNotThrow(emit);

debug.start(['fhqwhgads']);

emit();
@@ -0,0 +1,17 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const path = require('path');
const spawnSync = require('child_process').spawnSync;

const emitUncaught = path.join(common.fixturesDir, 'debug-uncaught.js');
const result = spawnSync(process.execPath, [emitUncaught], {encoding: 'utf8'});

const expectedMessage =
"There was an internal error in Node's debugger. Please report this bug.";

assert.strictEqual(result.status, 1);
assert(result.stderr.includes(expectedMessage));
assert(result.stderr.includes('Error: sterrance'));

console.log(result.stdout);

0 comments on commit 733233d

Please sign in to comment.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.