• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2require('../common');
3
4// This test ensures Node.js doesn't crash on hitting Ctrl+C in order to
5// terminate the currently running process (especially on FreeBSD).
6// https://github.com/nodejs/node-v0.x-archive/issues/9326
7
8const assert = require('assert');
9const child_process = require('child_process');
10
11// NOTE: Was crashing on FreeBSD
12const cp = child_process.spawn(process.execPath, [
13  '-e',
14  'process.kill(process.pid, "SIGINT")',
15]);
16
17cp.on('exit', function(code) {
18  assert.notStrictEqual(code, 0);
19});
20