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 https://github.com/atom/atom/pull/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.
Alternate Designs
Figure out why the Promise that gets returned by editor.update() never gets resolved. I've started investigating it and this only happens when this codepath gets executed.
The official tests for TextEditor seem to avoid awaiting for that Promise (e.g if we add an await in this line that test is going to fail), so I've left the proper investigation in a TODO comment.
Description of the Change
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 https://github.com/atom/atom/pull/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.
Alternate Designs
Figure out why the Promise that gets returned by
editor.update()
never gets resolved. I've started investigating it and this only happens when this codepath gets executed.The official tests for
TextEditor
seem to avoid awaiting for that Promise (e.g if we add anawait
in this line that test is going to fail), so I've left the proper investigation in a TODO comment.Benefits
This unblocks merging https://github.com/atom/atom/pull/18917
Possible Drawbacks
N/A
Applicable Issues
N/A