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

Introduced a gulp task `test:server` which only run Karma.

Kamil Piechaczek 9 лет назад
Родитель
Сommit
54d6888ab3
1 измененных файлов с 16 добавлено и 3 удалено
  1. 16 3
      gulpfile.js

+ 16 - 3
gulpfile.js

@@ -172,8 +172,21 @@ gulp.task( 'docs:editors', [ 'compile:js:esnext', 'compile:themes:esnext' ], ()
 
 // Tests. ---------------------------------------------------------------------
 
+const tests = require( '@ckeditor/ckeditor5-dev-tests' );
+
 gulp.task( 'test', () => {
-	const tests = require( '@ckeditor/ckeditor5-dev-tests' );
+	return tests.tasks.test( getKarmaOptions() );
+} );
+
+// Requires compiled sources. Task should be used parallel with `gulp compile --formats=esnext --watch`.
+gulp.task( 'test:server', () => {
+	const options = getKarmaOptions();
+	options.sourcePath = path.resolve( config.MODULE_DIR.esnext );
+
+	return tests.tasks.runTests( options );
+} );
+
+function getKarmaOptions() {
 	const options = tests.utils.parseArguments();
 
 	options.packages = getCKEditor5PackagesPaths();
@@ -184,5 +197,5 @@ gulp.task( 'test', () => {
 			.map( ( packagePath ) => tests.utils.getPackageName( path.resolve( packagePath ) ) );
 	}
 
-	return tests.tasks.test( options );
-} );
+	return options;
+}