Sfoglia il codice sorgente

Add memory leak test.

Maciej Gołaszewski 6 anni fa
parent
commit
3fc60fd593
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      packages/ckeditor5-build-classic/tests/ckeditor.js

+ 8 - 1
packages/ckeditor5-build-classic/tests/ckeditor.js

@@ -7,6 +7,7 @@
 
 import ClassicEditor from '../src/ckeditor';
 import BaseClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
+import { describeMemoryUsage, testMemoryUsage } from '@ckeditor/ckeditor5-core/tests/_utils/memory';
 
 describe( 'ClassicEditor build', () => {
 	let editor, editorElement;
@@ -23,7 +24,7 @@ describe( 'ClassicEditor build', () => {
 		editor = null;
 	} );
 
-	describe( 'buid', () => {
+	describe( 'build', () => {
 		it( 'contains plugins', () => {
 			expect( ClassicEditor.builtinPlugins ).to.not.be.empty;
 		} );
@@ -200,4 +201,10 @@ describe( 'ClassicEditor build', () => {
 				} );
 		} );
 	} );
+
+	describeMemoryUsage( () => {
+		testMemoryUsage(
+			'should not grow on multiple create/destroy',
+			() => ClassicEditor.create( document.querySelector( '#mem-editor' ) ) );
+	} );
 } );