8
0
Просмотр исходного кода

Extract magic numbers to constants.

Maciej Gołaszewski 7 лет назад
Родитель
Сommit
d740789578
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      packages/ckeditor5-core/tests/_utils/memory.js

+ 5 - 2
packages/ckeditor5-core/tests/_utils/memory.js

@@ -5,6 +5,9 @@
 
 /* global window, document, setTimeout */
 
+const TEST_TIMEOUT = 6000;
+const GARBAGE_COLLECTOR_TIMEOUT = 500;
+
 /**
  * @param {Function} callback Callback with test suit body
  */
@@ -26,7 +29,7 @@ export function describeMemoryUsage( callback ) {
  */
 export function testMemoryUsage( testName, editorCreator ) {
 	it( testName, function() {
-		this.timeout( 6000 );
+		this.timeout( TEST_TIMEOUT );
 
 		return runTest( editorCreator );
 	} );
@@ -119,7 +122,7 @@ function collectMemoryStats() {
 				usedJSHeapSize: memeInfo.usedJSHeapSize,
 				jsHeapSizeLimit: memeInfo.jsHeapSizeLimit
 			} );
-		}, 500 );
+		}, GARBAGE_COLLECTOR_TIMEOUT );
 	} );
 }