1'use strict'; 2const common = require('../common'); 3const assert = require('assert'); 4const spawn = require('child_process').spawn; 5const fixtures = require('../common/fixtures'); 6 7const child = spawn(process.argv[0], [fixtures.path('should_exit.js')]); 8child.stdout.once('data', function() { 9 child.kill('SIGINT'); 10}); 11child.on('exit', common.mustCall(function(exitCode, signalCode) { 12 assert.strictEqual(exitCode, null); 13 assert.strictEqual(signalCode, 'SIGINT'); 14})); 15