Procházet zdrojové kódy

Tests: Added a timer for callback function.

Kamil Piechaczek před 6 roky
rodič
revize
ac11990a01
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      packages/ckeditor5-watchdog/tests/watchdog.js

+ 3 - 1
packages/ckeditor5-watchdog/tests/watchdog.js

@@ -891,6 +891,8 @@ describe( 'Watchdog', () => {
 					Promise.resolve().then( () => throwCKEditorError( 'foo', watchdog.editor ) );
 
 					return new Promise( res => {
+						// This `setTimeout` needs to have a timer defined because Firefox calls the code in random order
+						// and causes the test failed.
 						setTimeout( () => {
 							window.onerror = originalErrorHandler;
 
@@ -902,7 +904,7 @@ describe( 'Watchdog', () => {
 							expect( watchdog.crashes[ 0 ].colno ).to.be.an( 'undefined' );
 
 							watchdog.destroy().then( res );
-						} );
+						}, 10 );
 					} );
 				} );
 			} );