8
0
Quellcode durchsuchen

Concretized method name.

Piotrek Koszuliński vor 9 Jahren
Ursprung
Commit
614e9cabc9
2 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen
  1. 4 4
      dev/tasks/bundle/utils.js
  2. 4 4
      dev/tests/bundle/utils.js

+ 4 - 4
dev/tasks/bundle/utils.js

@@ -40,7 +40,7 @@ const utils = {
 	 *
 	 * @param {String} modulePath Path to the module (without extension).
 	 */
-	getFullPath( modulePath ) {
+	getModuleFullPath( modulePath ) {
 		// If path is not a relative path (no leading ./ or ../).
 		if ( modulePath.charAt( 0 ) != '.' ) {
 			return `./${ path.join( 'build/esnext/ckeditor5', modulePath ) }.js`;
@@ -58,10 +58,10 @@ const utils = {
 	 */
 	getPluginPath( name ) {
 		if ( name.indexOf( '/' ) >= 0 ) {
-			return utils.getFullPath( name );
+			return utils.getModuleFullPath( name );
 		}
 
-		return utils.getFullPath( `${ name }/${ name }` );
+		return utils.getModuleFullPath( `${ name }/${ name }` );
 	},
 
 	/**
@@ -86,7 +86,7 @@ const utils = {
 	 */
 	renderEntryFileContent( dir, data ) {
 		const creatorName = utils.capitalize( path.basename( data.editor, '.js' ) );
-		const creatorPath = path.relative( dir, utils.getFullPath( data.editor ) );
+		const creatorPath = path.relative( dir, utils.getModuleFullPath( data.editor ) );
 		let featureNames = [];
 
 		// Returns a list of plugin imports.

+ 4 - 4
dev/tests/bundle/utils.js

@@ -31,14 +31,14 @@ describe( 'bundle-utils', () => {
 		expect( utils.clean ).to.equal( mainUtils.clean );
 	} );
 
-	describe( 'getFullPath', () => {
+	describe( 'getModuleFullPath', () => {
 		it( 'should return full path when passed path not relative', () => {
-			expect( utils.getFullPath( 'editor-classic/classic' ) ).to.equal( './build/esnext/ckeditor5/editor-classic/classic.js' );
+			expect( utils.getModuleFullPath( 'editor-classic/classic' ) ).to.equal( './build/esnext/ckeditor5/editor-classic/classic.js' );
 		} );
 
 		it( 'should return unmodified path when passed path is a relative', () => {
-			expect( utils.getFullPath( './path/to/editor-classic/classic' ) ).to.equal( './path/to/editor-classic/classic.js' );
-			expect( utils.getFullPath( '../path/to/editor-classic/classic' ) ).to.equal( '../path/to/editor-classic/classic.js' );
+			expect( utils.getModuleFullPath( './path/to/editor-classic/classic' ) ).to.equal( './path/to/editor-classic/classic.js' );
+			expect( utils.getModuleFullPath( '../path/to/editor-classic/classic' ) ).to.equal( '../path/to/editor-classic/classic.js' );
 		} );
 	} );