Wait for repo to refresh in test

This commit is contained in:
Max Brunsfeld
2017-09-27 14:19:05 -07:00
parent ce105ab914
commit 6a86a1c7bf

View File

@@ -283,11 +283,15 @@ describe "GitRepository", ->
[editor] = []
beforeEach ->
statusRefreshed = false
atom.project.setPaths([copyRepository()])
atom.project.getRepositories()[0].onDidChangeStatuses -> statusRefreshed = true
waitsForPromise ->
atom.workspace.open('other.txt').then (o) -> editor = o
waitsFor 'repo to refresh', -> statusRefreshed
it "emits a status-changed event when a buffer is saved", ->
editor.insertNewline()