Skip to content

Commit

Permalink
Add unit test for new no send behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
tomudding committed Apr 11, 2022
1 parent d24873b commit 14d5299
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/server/test/unit/plugins/util_spec.js
Expand Up @@ -10,6 +10,7 @@ describe('lib/plugins/util', () => {
this.theProcess = {
send: sinon.spy(),
on: sinon.stub(),
connected: true,
}

this.ipc = util.wrapIpc(this.theProcess)
Expand All @@ -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()

Expand Down

0 comments on commit 14d5299

Please sign in to comment.