diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index a1cd8d67e..4cef9f136 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -173,19 +173,22 @@ describe('TextEditorComponent', () => { expect(actualWidth).toBe(expectedWidth + 'px') } - // Make sure we do not throw an error if a synchronous update is - // triggered before measuring the longest line from a - // previously-scheduled update. - editor.getBuffer().insert(Point(12, Infinity), 'x'.repeat(100)) - expect(editor.getLongestScreenRow()).toBe(12) + // eslint-disable-next-line no-lone-blocks + { + // Make sure we do not throw an error if a synchronous update is + // triggered before measuring the longest line from a + // previously-scheduled update. + editor.getBuffer().insert(Point(12, Infinity), 'x'.repeat(100)) + expect(editor.getLongestScreenRow()).toBe(12) - TextEditorComponent.getScheduler().readDocument(() => { - // This will happen before the measurement phase of the update - // triggered above. - component.pixelPositionForScreenPosition(Point(11, Infinity)) - }) + TextEditorComponent.getScheduler().readDocument(() => { + // This will happen before the measurement phase of the update + // triggered above. + component.pixelPositionForScreenPosition(Point(11, Infinity)) + }) - await component.getNextUpdatePromise() + await component.getNextUpdatePromise() + } }) it('re-renders lines when their height changes', async () => {