Explorar el Código

Handle rejected promises.

Piotrek Koszuliński hace 8 años
padre
commit
8ad72be679
Se han modificado 1 ficheros con 13 adiciones y 5 borrados
  1. 13 5
      packages/ckeditor5-engine/tests/view/manual/uielement.js

+ 13 - 5
packages/ckeditor5-engine/tests/view/manual/uielement.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  */
 
-/* global document */
+/* globals console, window, document */
 
 import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
 import Enter from '@ckeditor/ckeditor5-enter/src/enter';
@@ -37,7 +37,15 @@ class UIElementTestPlugin extends Plugin {
 	}
 }
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Enter, Typing, Paragraph, Undo, UIElementTestPlugin ],
-	toolbar: [ 'undo', 'redo' ]
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Enter, Typing, Paragraph, Undo, UIElementTestPlugin ],
+		toolbar: [ 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );
+