|
|
|
@ -24,8 +24,7 @@ module.exports = { |
|
|
|
const runStub = sinon.stub(command, 'run').returns('result'); |
|
|
|
|
|
|
|
const result = command.callRun(editor); |
|
|
|
|
|
|
|
expect(editorTriggerSpy.calledTwice).toEqual(true); |
|
|
|
expect(editorTriggerSpy.callCount).toEqual(3); |
|
|
|
expect(editorTriggerSpy.getCall(0).args).toEqual([ |
|
|
|
'run:test:before', |
|
|
|
{} |
|
|
|
@ -35,6 +34,12 @@ module.exports = { |
|
|
|
'result', |
|
|
|
{} |
|
|
|
]); |
|
|
|
expect(editorTriggerSpy.getCall(2).args).toEqual([ |
|
|
|
'run', |
|
|
|
'test', |
|
|
|
'result', |
|
|
|
{} |
|
|
|
]); |
|
|
|
|
|
|
|
expect(result).toEqual('result'); |
|
|
|
expect(runStub.calledOnce).toEqual(true); |
|
|
|
@ -64,7 +69,7 @@ module.exports = { |
|
|
|
|
|
|
|
const result = command.callStop(editor); |
|
|
|
|
|
|
|
expect(editorTriggerSpy.calledTwice).toEqual(true); |
|
|
|
expect(editorTriggerSpy.callCount).toEqual(3); |
|
|
|
expect(editorTriggerSpy.getCall(0).args).toEqual([ |
|
|
|
'stop:test:before', |
|
|
|
{} |
|
|
|
@ -74,6 +79,12 @@ module.exports = { |
|
|
|
'stopped', |
|
|
|
{} |
|
|
|
]); |
|
|
|
expect(editorTriggerSpy.getCall(2).args).toEqual([ |
|
|
|
'stop', |
|
|
|
'test', |
|
|
|
'stopped', |
|
|
|
{} |
|
|
|
]); |
|
|
|
|
|
|
|
expect(result).toEqual('stopped'); |
|
|
|
expect(stopStub.calledOnce).toEqual(true); |
|
|
|
|