diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index 80eac5261..ba9e414ac 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -25,6 +25,8 @@ document.registerElement('text-editor-component-test-element', { }) }) +const editors = [] + describe('TextEditorComponent', () => { beforeEach(() => { jasmine.useRealClock() @@ -35,6 +37,13 @@ describe('TextEditorComponent', () => { jasmine.attachToDOM(scrollbarStyle) }) + afterEach(() => { + for (const editor of editors) { + editor.destroy() + } + editors.length = 0 + }) + describe('rendering', () => { it('renders lines and line numbers for the visible region', async () => { const {component, element, editor} = buildComponent({rowsPerTile: 3, autoHeight: false}) @@ -4486,6 +4495,7 @@ function buildEditor (params = {}) { const editor = new TextEditor(editorParams) editor.testAutoscrollRequests = [] editor.onDidRequestAutoscroll((request) => { editor.testAutoscrollRequests.push(request) }) + editors.push(editor) return editor }