Skip to content

Commit 2ead453

Browse files
committed
[test] Test kill action
1 parent a0d09d2 commit 2ead453

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/worker-test.js

+14
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ vows.describe('forever/worker').addBatch({
3333
assert.isObject(obj.data);
3434
assert.deepEqual(obj.data, obj.monitor.data);
3535
}
36+
},
37+
'and when asked to kill the process': {
38+
topic: function (reader, _, options) {
39+
var self = this;
40+
41+
options.monitor.running = true;
42+
reader.send(['kill']);
43+
reader.data(['kill', 'stop'], function () {
44+
self.callback(null, options.monitor);
45+
});
46+
},
47+
'it should kill the process': function (monitor) {
48+
assert.isFalse(monitor.running);
49+
}
3650
}
3751
})
3852
}

0 commit comments

Comments
 (0)