diff --git a/packages/server/test/unit/plugins/util_spec.js b/packages/server/test/unit/plugins/util_spec.js index af64da26c552..0862675652be 100644 --- a/packages/server/test/unit/plugins/util_spec.js +++ b/packages/server/test/unit/plugins/util_spec.js @@ -10,6 +10,7 @@ describe('lib/plugins/util', () => { this.theProcess = { send: sinon.spy(), on: sinon.stub(), + connected: true, } this.ipc = util.wrapIpc(this.theProcess) @@ -31,6 +32,13 @@ describe('lib/plugins/util', () => { expect(this.theProcess.send).not.to.be.called }) + it('#send does not send if process has been disconnected', function () { + this.theProcess.connected = false + this.ipc.send('event-name') + + expect(this.theProcess.send).not.to.be.called + }) + it('#on listens for process messages that match event', function () { const handler = sinon.spy()