Преглед изворни кода

Introduced `@ckeditor/ckeditor5-dev-tests` package.

Kamil Piechaczek пре 9 година
родитељ
комит
8112a6b473
3 измењених фајлова са 20 додато и 0 уклоњено
  1. 2 0
      dev/bender/plugins/ckeditor5/static/extensions.js
  2. 17 0
      gulpfile.js
  3. 1 0
      package.json

+ 2 - 0
dev/bender/plugins/ckeditor5/static/extensions.js

@@ -16,6 +16,8 @@
 
 		if ( moduleId[ 0 ] == '/' ) {
 			url = basePath + url;
+		} else if ( moduleId.startsWith( 'ckeditor5' ) || moduleId.startsWith( 'tests' ) || moduleId.startsWith( 'theme' ) ) {
+			url = basePath + '/' + url;
 		}
 
 		return load( context, moduleId, url );

+ 17 - 0
gulpfile.js

@@ -7,6 +7,7 @@
 
 'use strict';
 
+const path = require( 'path' );
 const gulp = require( 'gulp' );
 const runSequence = require( 'run-sequence' );
 
@@ -169,3 +170,19 @@ gulp.task( 'docs:build', docsBuilder.buildDocs );
 gulp.task( 'docs:editors', [ 'compile:js:esnext', 'compile:themes:esnext' ], () => {
 	return docsBuilder.buildEditorsForSamples( getCKEditor5PackagesPaths(), config.DOCUMENTATION.SAMPLES );
 } );
+
+// Tests. ---------------------------------------------------------------------
+
+gulp.task( 'test', () => {
+	const ckeditor5DevTests = require( '@ckeditor/ckeditor5-dev-tests' );
+	const options = ckeditor5DevTests.utils.parseArguments();
+
+	options.rootPath = path.resolve( config.MODULE_DIR.esnext );
+
+	if ( !options.paths ) {
+		options.paths = ckeditor5DevCompiler.utils.getPackages( '.' )
+			.map( ( packagePath ) => ckeditor5DevTests.utils.getPackageName( path.resolve( packagePath ) ) );
+	}
+
+	return ckeditor5DevTests.tests.test( options );
+} );

+ 1 - 0
package.json

@@ -35,6 +35,7 @@
     "@ckeditor/ckeditor5-dev-env": "^1.0.0",
     "@ckeditor/ckeditor5-dev-lint": "^1.0.1",
     "@ckeditor/ckeditor5-dev-utils": "^1.1.0",
+    "@ckeditor/ckeditor5-dev-tests": "ckeditor/ckeditor5-dev-tests",
     "babel-polyfill": "^6.13.0",
     "benderjs": "^0.4.1",
     "benderjs-chai": "^0.2.0",