diff --git a/spec/git-repository-async-spec.js b/spec/git-repository-async-spec.js index 82d4b6f24..74bf8ef16 100644 --- a/spec/git-repository-async-spec.js +++ b/spec/git-repository-async-spec.js @@ -319,12 +319,15 @@ describe('GitRepositoryAsync', () => { editor.insertNewline() - let called - repository.onDidChangeStatus(c => called = c) + const statusHandler = jasmine.createSpy('statusHandler') + repository.onDidChangeStatus(statusHandler) editor.save() - waitsFor(() => Boolean(called)) - runs(() => expect(called).toEqual({path: editor.getPath(), pathStatus: 256})) + waitsFor(() => statusHandler.callCount > 0) + runs(() => { + expect(statusHandler.callCount).toBeGreaterThan(0) + expect(statusHandler).toHaveBeenCalledWith({path: editor.getPath(), pathStatus: 256}) + }) }) it('emits a status-changed event when a buffer is reloaded', async () => {