Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Testing Process's SIGINT interception
(function(Process) {
describe('Process', function() {
it('intercepts sig int', function(done) {
Process.on('exit', function(exitPromises) {
var exitProcess = new RSVP.Promise(function(resolve, reject) {
setTimeout(function() {
resolve(true);
}, 100);
});
exitPromises(exitProcess);
})
process.emit('SIGINT');
})
it('closes streams on sig int', function(done) {
var fileBuffer = {file : 'processFileBufferTestObjects.json'};
var fb = new COMPOSITE.FileBuffer(fileBuffer);
fb.add({id : 'test'});
process.emit('SIGINT');
fs.unlink('processFileBufferTestObjects.json');
done();
})
})
})(COMPOSITE.Process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment