From cbd55cd92147d83e50e89271202ef2ecb56437a9 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 21 Nov 2017 11:57:44 -0800 Subject: [PATCH] Fix incorrectly written async test --- spec/text-editor-element-spec.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/text-editor-element-spec.js b/spec/text-editor-element-spec.js index 7cdd374a1..686b52757 100644 --- a/spec/text-editor-element-spec.js +++ b/spec/text-editor-element-spec.js @@ -77,13 +77,11 @@ describe('TextEditorElement', () => { }) describe('when the model is assigned', () => - it("adds the 'mini' attribute if .isMini() returns true on the model", function (done) { + it("adds the 'mini' attribute if .isMini() returns true on the model", async () => { const element = buildTextEditorElement() element.getModel().update({mini: true}) - atom.views.getNextUpdatePromise().then(() => { - expect(element.hasAttribute('mini')).toBe(true) - done() - }) + await atom.views.getNextUpdatePromise() + expect(element.hasAttribute('mini')).toBe(true) }) ) @@ -268,7 +266,7 @@ describe('TextEditorElement', () => { }) ) - describe('::setUpdatedSynchronously', () => + describe('::setUpdatedSynchronously', () => { it('controls whether the text editor is updated synchronously', () => { spyOn(window, 'requestAnimationFrame').andCallFake(fn => fn()) @@ -288,7 +286,7 @@ describe('TextEditorElement', () => { expect(window.requestAnimationFrame).not.toHaveBeenCalled() expect(element.textContent).toContain('goodbye') }) - ) + }) describe('::getDefaultCharacterWidth', () => { it('returns 0 before the element is attached', () => {