Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 03a2a02

Browse files
committed
Don't return an unresolved Promise on beforeEach()
The `editor.update()` method returns a Promise, which under some circumstances (on specs mostly) never gets resolved. Because of CoffeeScript's implicit returns, this Promise was returned on the `beforeEach()` method of these tests. Before atom/atom#18917, any Promise that was returned by a spec method was just discarded, so this behaviour didn't cause any issue, but once we merge that PR this test is going to start failing because jasmine will wait indefinitely until the Promise is resolved.
1 parent f1386c5 commit 03a2a02

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/snippets-spec.coffee

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,10 @@ describe "Snippets extension", ->
481481
describe "when the snippet spans multiple lines", ->
482482
beforeEach ->
483483
editor.update({autoIndent: true})
484+
# editor.update() returns a Promise that never gets resolved, so we
485+
# need to return undefined to avoid a timeout in the spec.
486+
# TODO: Figure out why `editor.update({autoIndent: true})` never gets resolved.
487+
return
484488

485489
it "places tab stops correctly", ->
486490
expect(editor.getSoftTabs()).toBeTruthy()

0 commit comments

Comments
 (0)