mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Fix race condition in spec
This commit is contained in:
@@ -308,10 +308,11 @@ describe "Editor", ->
|
||||
|
||||
spyOn(atom, "confirm")
|
||||
|
||||
contentsConflictedHandler = jasmine.createSpy("contentsConflictedHandler")
|
||||
editSession.on 'contents-conflicted', contentsConflictedHandler
|
||||
fs.write(path, "a file change")
|
||||
|
||||
waitsFor "file to trigger contents-changed event", (done) ->
|
||||
editSession.one 'contents-conflicted', done
|
||||
waitsFor ->
|
||||
contentsConflictedHandler.callCount > 0
|
||||
|
||||
runs ->
|
||||
expect(atom.confirm).toHaveBeenCalled()
|
||||
|
||||
Reference in New Issue
Block a user