Przeglądaj źródła

Porting... porting... porting.

Piotrek Koszuliński 10 lat temu
rodzic
commit
9cf558b553

+ 2 - 2
packages/ckeditor5-utils/src/emittermixin.js

@@ -13,7 +13,7 @@
  */
 
 import EventInfo from './eventinfo.js';
-import { uid } from './utils.js';
+import utils from './utils.js';
 
 const EmitterMixin = {
 	/**
@@ -134,7 +134,7 @@ const EmitterMixin = {
 		}
 
 		if ( !( emitterId = emitter._emitterId ) ) {
-			emitterId = emitter._emitterId = uid();
+			emitterId = emitter._emitterId = utils.uid();
 		}
 
 		if ( !( emitterInfo = emitters[ emitterId ] ) ) {

+ 3 - 3
packages/ckeditor5-utils/src/eventinfo.js

@@ -12,7 +12,7 @@
  * @class EventInfo
  */
 
-import { spy } from './utils.js';
+import utils from './utils.js';
 
 export default class EventInfo {
 	constructor( source, name ) {
@@ -33,13 +33,13 @@ export default class EventInfo {
 		 *
 		 * @method
 		 */
-		this.stop = spy();
+		this.stop = utils.spy();
 
 		/**
 		 * Removes the current callback from future interactions of this event.
 		 *
 		 * @method
 		 */
-		this.off = spy();
+		this.off = utils.spy();
 	}
 }

+ 94 - 90
packages/ckeditor5-utils/src/utils.js

@@ -5,121 +5,125 @@
 
 'use strict';
 
-/**
- * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.
- *
- * The following are the present features:
- *
- *  * spy.called: property set to `true` if the function has been called at least once.
- *
- * @returns {Function} The spy function.
- */
-export function spy() {
-	return function spy() {
-		spy.called = true;
-	};
-}
+const utils = {
+	/**
+	 * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.
+	 *
+	 * The following are the present features:
+	 *
+	 *  * spy.called: property set to `true` if the function has been called at least once.
+	 *
+	 * @returns {Function} The spy function.
+	 */
+	spy() {
+		return function spy() {
+			spy.called = true;
+		};
+	},
 
-/**
- * Returns a unique id. This id is a number (starting from 1) which will never get repeated on successive calls
- * to this method.
- *
- * @returns {Number} A number representing the id.
- */
-export let uid = ( () => {
-	let next = 1;
+	/**
+	 * Returns a unique id. This id is a number (starting from 1) which will never get repeated on successive calls
+	 * to this method.
+	 *
+	 * @returns {Number} A number representing the id.
+	 */
+	uid: ( () => {
+		let next = 1;
 
-	return () => {
-		return next++;
-	};
-} )();
+		return () => {
+			return next++;
+		};
+	} )(),
 
-/**
- * Checks if value implements iterator interface.
- *
- * @param {Mixed} value The value to check.
- * @returns {Boolean} True if value implements iterator interface.
- */
-export function isIterable( value ) {
-	return !!( value && value[ Symbol.iterator ] );
-}
+	/**
+	 * Checks if value implements iterator interface.
+	 *
+	 * @param {Mixed} value The value to check.
+	 * @returns {Boolean} True if value implements iterator interface.
+	 */
+	isIterable( value ) {
+		return !!( value && value[ Symbol.iterator ] );
+	},
 
-/**
- * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array
- * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,
- * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned
- * it means that arrays differ.
- *
- *   compareArrays( [ 0, 2 ], [ 0, 2 ] ); // SAME
- *   compareArrays( [ 0, 2 ], [ 0, 2, 1 ] ); // PREFIX
- *   compareArrays( [ 0, 2 ], [ 0 ] ); // EXTENSION
- *   compareArrays( [ 0, 2 ], [ 1, 2 ] ); // 0
- *   compareArrays( [ 0, 2 ], [ 0, 1 ] ); // 1
- *
- * @param {Array} a Array that is compared.
- * @param {Array} b Array to compare with.
- * @returns {Number} An index at which arrays differ, or if they do not differ, how array `a` is related to array `b`.
- * This is represented by one of flags: `a` is {@link utils.compareArrays#SAME same}, `a` is
- * a {@link utils.compareArrays#PREFIX prefix) or `a` is an {@link utils.compareArrays#EXTENSION extension}.
- */
-export function compareArrays( a, b ) {
-	const minLen = Math.min( a.length, b.length );
+	/**
+	 * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array
+	 * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,
+	 * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned
+	 * it means that arrays differ.
+	 *
+	 *   compareArrays( [ 0, 2 ], [ 0, 2 ] ); // SAME
+	 *   compareArrays( [ 0, 2 ], [ 0, 2, 1 ] ); // PREFIX
+	 *   compareArrays( [ 0, 2 ], [ 0 ] ); // EXTENSION
+	 *   compareArrays( [ 0, 2 ], [ 1, 2 ] ); // 0
+	 *   compareArrays( [ 0, 2 ], [ 0, 1 ] ); // 1
+	 *
+	 * @param {Array} a Array that is compared.
+	 * @param {Array} b Array to compare with.
+	 * @returns {Number} An index at which arrays differ, or if they do not differ, how array `a` is related to array `b`.
+	 * This is represented by one of flags: `a` is {@link utils.compareArrays#SAME same}, `a` is
+	 * a {@link utils.compareArrays#PREFIX prefix) or `a` is an {@link utils.compareArrays#EXTENSION extension}.
+	 */
+	compareArrays( a, b ) {
+		const minLen = Math.min( a.length, b.length );
 
-	for ( let i = 0; i < minLen; i++ ) {
-		if ( a[ i ] != b[ i ] ) {
-			// The arrays are different.
-			return i;
+		for ( let i = 0; i < minLen; i++ ) {
+			if ( a[ i ] != b[ i ] ) {
+				// The arrays are different.
+				return i;
+			}
 		}
-	}
 
-	// Both arrays were same at all points.
-	if ( a.length == b.length ) {
-		// If their length is also same, they are the same.
-		return compareArrays.SAME;
-	} else if ( a.length < b.length ) {
-		// Compared array is shorter so it is a prefix of the other array.
-		return compareArrays.PREFIX;
-	} else {
-		// Compared array is longer so it is an extension of the other array.
-		return compareArrays.EXTENSION;
-	}
-}
+		// Both arrays were same at all points.
+		if ( a.length == b.length ) {
+			// If their length is also same, they are the same.
+			return utils.compareArrays.SAME;
+		} else if ( a.length < b.length ) {
+			// Compared array is shorter so it is a prefix of the other array.
+			return utils.compareArrays.PREFIX;
+		} else {
+			// Compared array is longer so it is an extension of the other array.
+			return utils.compareArrays.EXTENSION;
+		}
+	},
 
-/**
- * Returns `nth` (starts from `0` of course) item of an `iterable`.
- *
- * @param {Number} index
- * @param {Iterable.<*>} iterable
- * @returns {*}
- */
-export function nth( index, iterable ) {
-	for ( let item of iterable ) {
-		if ( index === 0 ) {
-			return item;
+	/**
+	 * Returns `nth` (starts from `0` of course) item of an `iterable`.
+	 *
+	 * @param {Number} index
+	 * @param {Iterable.<*>} iterable
+	 * @returns {*}
+	 */
+	nth( index, iterable ) {
+		for ( let item of iterable ) {
+			if ( index === 0 ) {
+				return item;
+			}
+			index -= 1;
 		}
-		index -= 1;
-	}
 
-	return null;
-}
+		return null;
+	}
+};
 
 /**
  * Flag for "is same as" relation between arrays.
  *
  * @type {Number}
  */
-compareArrays.SAME = -1;
+utils.compareArrays.SAME = -1;
 
 /**
  * Flag for "is a prefix of" relation between arrays.
  *
  * @type {Number}
  */
-compareArrays.PREFIX = -2;
+utils.compareArrays.PREFIX = -2;
 
 /**
  * Flag for "is a suffix of" relation between arrays.
  *
  * @type {number}
  */
-compareArrays.EXTENSION = -3;
+utils.compareArrays.EXTENSION = -3;
+
+export default utils;

+ 7 - 11
packages/ckeditor5-utils/tests/_tools/tools.js

@@ -13,22 +13,18 @@
 		 * If `proto` is not set or it does not define `create()` and `destroy()` methods,
 		 * then they will be set to Sinon spies. Therefore the shortest usage is:
 		 *
-		 *	  bender.tools.defineEditorCreatorMock( 'test1' );
+		 *		bender.tools.defineEditorCreatorMock( 'test1' );
 		 *
 		 * The mocked creator is available under:
 		 *
-		 *	  editor.plugins.get( 'creator-thename' );
+		 *		editor.plugins.get( 'creator-thename' );
 		 *
 		 * @param {String} creatorName Name of the creator.
 		 * @param {Object} [proto] Prototype of the creator. Properties from the proto param will
 		 * be copied to the prototype of the creator.
 		 */
-		defineEditorCreatorMock: ( creatorName, proto ) => {
-			CKEDITOR.define( 'plugin!creator-' + creatorName, [ 'creator' ], ( Creator ) => {
-				return mockCreator( Creator );
-			} );
-
-			function mockCreator( Creator ) {
+		defineEditorCreatorMock( creatorName, proto ) {
+			bender.amd.define( 'creator-' + creatorName, [ 'core/creator' ], ( Creator ) => {
 				class TestCreator extends Creator {}
 
 				if ( proto ) {
@@ -46,18 +42,18 @@
 				}
 
 				return TestCreator;
-			}
+			} );
 		},
 
 		/**
 		 * Returns the number of elements return by the iterator.
 		 *
-		 *	  bender.tools.core.getIteratorCount( [ 1, 2, 3, 4, 5 ] ); // 5;
+		 *		bender.tools.core.getIteratorCount( [ 1, 2, 3, 4, 5 ] ); // 5;
 		 *
 		 * @param {Iterable.<*>} iterator Any iterator.
 		 * @returns {Number} Number of elements returned by that iterator.
 		 */
-		getIteratorCount: ( iterator ) => {
+		getIteratorCount( iterator ) {
 			let count = 0;
 
 			for ( let _ of iterator ) { // jshint ignore:line

+ 13 - 9
packages/ckeditor5-utils/tests/bender/tools.js

@@ -20,16 +20,20 @@ bender.tools.core.defineEditorCreatorMock( 'test3', {
 	destroy: destroyFn3
 } );
 
-const modules = bender.amd.require( 'creator', 'plugin!creator-test1', 'plugin!creator-test2', 'plugin!creator-test3' );
+const modules = bender.amd.require( 'core/creator', 'creator-test1', 'creator-test2', 'creator-test3' );
+let Creator;
 
 ///////////////////
 
+before( () => {
+	Creator = modules[ 'core/creator' ];
+} );
+
 describe( 'bender.tools.core.defineEditorCreatorMock()', () => {
 	it( 'should register all creators', () => {
-		const Creator = modules.creator;
-		const TestCreator1 = modules[ 'plugin!creator-test1' ];
-		const TestCreator2 = modules[ 'plugin!creator-test2' ];
-		const TestCreator3 = modules[ 'plugin!creator-test3' ];
+		const TestCreator1 = modules[ 'creator-test1' ];
+		const TestCreator2 = modules[ 'creator-test2' ];
+		const TestCreator3 = modules[ 'creator-test3' ];
 
 		expect( TestCreator1.prototype ).to.be.instanceof( Creator );
 		expect( TestCreator2.prototype ).to.be.instanceof( Creator );
@@ -37,16 +41,16 @@ describe( 'bender.tools.core.defineEditorCreatorMock()', () => {
 	} );
 
 	it( 'should copy properties from the second argument', () => {
-		const TestCreator = modules[ 'plugin!creator-test2' ];
+		const TestCreator = modules[ 'creator-test2' ];
 
 		expect( TestCreator.prototype ).to.have.property( 'foo', 1 );
 		expect( TestCreator.prototype ).to.have.property( 'bar', 2 );
 	} );
 
 	it( 'should create spies for create() and destroy() if not defined', () => {
-		const TestCreator1 = modules[ 'plugin!creator-test1' ];
-		const TestCreator2 = modules[ 'plugin!creator-test2' ];
-		const TestCreator3 = modules[ 'plugin!creator-test3' ];
+		const TestCreator1 = modules[ 'creator-test1' ];
+		const TestCreator2 = modules[ 'creator-test2' ];
+		const TestCreator3 = modules[ 'creator-test3' ];
 
 		expect( TestCreator1.prototype.create ).to.have.property( 'called', false, 'test1.create' );
 		expect( TestCreator1.prototype.destroy ).to.have.property( 'called', false, 'test1.destroy' );

+ 10 - 17
packages/ckeditor5-utils/tests/ckeditor/ckeditor.js

@@ -7,7 +7,7 @@
 
 'use strict';
 
-const modules = bender.amd.require( 'ckeditor', 'editor', 'config' );
+const modules = bender.amd.require( 'ckeditor', 'core/editor', 'core/config' );
 
 let content = document.getElementById( 'content' );
 let editorConfig = { plugins: 'creator-test' };
@@ -25,16 +25,19 @@ beforeEach( () => {
 } );
 
 describe( 'create', () => {
-	it( 'should return a promise', () => {
-		const CKEDITOR = modules.ckeditor;
+	let CKEDITOR, Editor, Config;
+
+	before( () => {
+		CKEDITOR = modules.ckeditor;
+		Editor = modules[ 'core/editor' ];
+		Config = modules[ 'core/config' ];
+	} );
 
+	it( 'should return a promise', () => {
 		expect( CKEDITOR.create( content, editorConfig ) ).to.be.instanceof( Promise );
 	} );
 
 	it( 'should create a new editor instance', () => {
-		const CKEDITOR = modules.ckeditor;
-		const Editor = modules.editor;
-
 		return CKEDITOR.create( content, editorConfig ).then( ( editor ) => {
 			expect( editor ).to.be.instanceof( Editor );
 			expect( editor.element ).to.equal( content );
@@ -42,9 +45,6 @@ describe( 'create', () => {
 	} );
 
 	it( 'should create a new editor instance (using a selector)', () => {
-		const CKEDITOR = modules.ckeditor;
-		const Editor = modules.editor;
-
 		return CKEDITOR.create( '.editor', editorConfig ).then( ( editor ) => {
 			expect( editor ).to.be.instanceof( Editor );
 			expect( editor.element ).to.equal( document.querySelector( '.editor' ) );
@@ -52,16 +52,12 @@ describe( 'create', () => {
 	} );
 
 	it( 'should set configurations on the new editor', () => {
-		const CKEDITOR = modules.ckeditor;
-
 		return CKEDITOR.create( content, { test: 1, plugins: 'creator-test' } ).then( ( editor ) => {
 			expect( editor.config.test ).to.equal( 1 );
 		} );
 	} );
 
 	it( 'should add the editor to the `instances` collection', () => {
-		const CKEDITOR = modules.ckeditor;
-
 		return CKEDITOR.create( content, editorConfig ).then( ( editor ) => {
 			expect( CKEDITOR.instances ).to.have.length( 1 );
 			expect( CKEDITOR.instances.get( 0 ) ).to.equal( editor );
@@ -69,7 +65,6 @@ describe( 'create', () => {
 	} );
 
 	it( 'should remove the editor from the `instances` collection on `destroy` event', () => {
-		const CKEDITOR = modules.ckeditor;
 		let editor1, editor2;
 
 		// Create the first editor.
@@ -96,8 +91,6 @@ describe( 'create', () => {
 	} );
 
 	it( 'should be rejected on element not found', () => {
-		const CKEDITOR = modules.ckeditor;
-
 		let addSpy = bender.sinon.spy( CKEDITOR.instances, 'add' );
 
 		return CKEDITOR.create( '.undefined' ).then( () => {
@@ -115,7 +108,7 @@ describe( 'create', () => {
 describe( 'config', () => {
 	it( 'should be an instance of Config', () => {
 		const CKEDITOR = modules.ckeditor;
-		const Config = modules.config;
+		const Config = modules[ 'core/config' ];
 
 		expect( CKEDITOR.config ).to.be.an.instanceof( Config );
 	} );

+ 7 - 6
packages/ckeditor5-utils/tests/ckeditorerror/ckeditorerror.js → packages/ckeditor5-utils/tests/ckeditorerror.js

@@ -5,11 +5,16 @@
 
 'use strict';
 
-const modules = bender.amd.require( 'ckeditorerror' );
+const modules = bender.amd.require( 'core/ckeditorerror' );
 
 describe( 'CKEditorError', () => {
+	let CKEditorError;
+
+	before( () => {
+		CKEditorError = modules[ 'core/ckeditorerror' ];
+	} );
+
 	it( 'inherits from Error', () => {
-		const CKEditorError = modules.ckeditorerror;
 		let error = new CKEditorError( 'foo' );
 
 		expect( error ).to.be.an.instanceOf( Error );
@@ -17,14 +22,12 @@ describe( 'CKEditorError', () => {
 	} );
 
 	it( 'sets the name', () => {
-		const CKEditorError = modules.ckeditorerror;
 		let error = new CKEditorError( 'foo' );
 
 		expect( error ).to.have.property( 'name', 'CKEditorError' );
 	} );
 
 	it( 'sets the message', () => {
-		const CKEditorError = modules.ckeditorerror;
 		let error = new CKEditorError( 'foo' );
 
 		expect( error ).to.have.property( 'message', 'foo' );
@@ -32,7 +35,6 @@ describe( 'CKEditorError', () => {
 	} );
 
 	it( 'sets the message and data', () => {
-		const CKEditorError = modules.ckeditorerror;
 		let data = { bar: 1 };
 		let error = new CKEditorError( 'foo', data );
 
@@ -47,7 +49,6 @@ describe( 'CKEditorError', () => {
 			}
 		}
 
-		const CKEditorError = modules.ckeditorerror;
 		let data = {
 			bar: 'a',
 			bom: new Foo(),

+ 3 - 3
packages/ckeditor5-utils/tests/collection/collection.js → packages/ckeditor5-utils/tests/collection.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-const modules = bender.amd.require( 'collection', 'ckeditorerror' );
+const modules = bender.amd.require( 'core/collection', 'core/ckeditorerror' );
 
 bender.tools.createSinonSandbox();
 
@@ -21,8 +21,8 @@ describe( 'Collection', () => {
 	let Collection, CKEditorError;
 
 	before( () => {
-		Collection = modules.collection;
-		CKEditorError = modules.CKEditorError;
+		Collection = modules[ 'core/collection' ];
+		CKEditorError = modules[ 'core/ckeditorerror' ];
 	} );
 
 	let collection;

+ 6 - 14
packages/ckeditor5-utils/tests/config/config.js → packages/ckeditor5-utils/tests/config.js

@@ -5,13 +5,15 @@
 
 'use strict';
 
-const modules = bender.amd.require( 'config' );
+const modules = bender.amd.require( 'core/config' );
 
-let config;
+let Config, config;
 
-beforeEach( () => {
-	const Config = modules.config;
+before( () => {
+	Config = modules[ 'core/config' ];
+} );
 
+beforeEach( () => {
 	config = new Config( {
 		creator: 'inline',
 		language: 'pl',
@@ -38,8 +40,6 @@ describe( 'constructor', () => {
 	} );
 
 	it( 'should work with no parameters', () => {
-		const Config = modules.config;
-
 		// No error should be thrown.
 		config = new Config();
 	} );
@@ -47,8 +47,6 @@ describe( 'constructor', () => {
 
 describe( 'set', () => {
 	it( 'should create Config instances for objects', () => {
-		const Config = modules.config;
-
 		expect( config.resize ).to.be.an.instanceof( Config );
 		expect( config.resize.icon ).to.be.an.instanceof( Config );
 	} );
@@ -112,8 +110,6 @@ describe( 'set', () => {
 	} );
 
 	it( 'should replace a simple entry with a Config instance', () => {
-		const Config = modules.config;
-
 		config.set( 'test', 1 );
 		config.set( 'test', {
 			prop: 1
@@ -124,8 +120,6 @@ describe( 'set', () => {
 	} );
 
 	it( 'should replace a simple entry with a Config instance when passing an object', () => {
-		const Config = modules.config;
-
 		config.set( 'test', 1 );
 		config.set( {
 			test: {
@@ -138,8 +132,6 @@ describe( 'set', () => {
 	} );
 
 	it( 'should replace a simple entry with a Config instance when passing a name.with.deep', () => {
-		const Config = modules.config;
-
 		config.set( 'test.prop', 1 );
 		config.set( 'test.prop.value', 1 );
 

+ 9 - 10
packages/ckeditor5-utils/tests/emittermixin/emittermixin.js → packages/ckeditor5-utils/tests/emittermixin.js

@@ -5,10 +5,16 @@
 
 'use strict';
 
-const modules = bender.amd.require( 'emittermixin', 'eventinfo', 'utils' );
-
+const modules = bender.amd.require( 'core/emittermixin', 'core/eventinfo', 'core/lib/lodash/object' );
+let EmitterMixin, EventInfo, utilsObject;
 let emitter, listener;
 
+before( () => {
+	EmitterMixin = modules[ 'core/emittermixin' ];
+	EventInfo = modules[ 'core/eventinfo' ];
+	utilsObject = modules[ 'core/lib/lodash/object' ];
+} );
+
 beforeEach( refreshEmitter );
 
 describe( 'fire', () => {
@@ -45,8 +51,6 @@ describe( 'fire', () => {
 	} );
 
 	it( 'should pass arguments to callbacks', () => {
-		const EventInfo = modules.eventinfo;
-
 		let spy1 = sinon.spy();
 		let spy2 = sinon.spy();
 
@@ -212,8 +216,6 @@ describe( 'once', () => {
 	} );
 
 	it( 'should have proper arguments', () => {
-		const EventInfo = modules.eventinfo;
-
 		let spy = sinon.spy();
 
 		emitter.once( 'test', spy );
@@ -419,8 +421,5 @@ function refreshListener() {
 }
 
 function getEmitterInstance() {
-	const EmitterMixin = modules.emittermixin;
-	let utils = modules.utils;
-
-	return utils.extend( {}, EmitterMixin );
+	return utilsObject.extend( {}, EmitterMixin );
 }

+ 7 - 7
packages/ckeditor5-utils/tests/eventinfo/eventinfo.js → packages/ckeditor5-utils/tests/eventinfo.js

@@ -5,12 +5,16 @@
 
 'use strict';
 
-const modules = bender.amd.require( 'eventinfo' );
+const modules = bender.amd.require( 'core/eventinfo' );
 
 describe( 'EventInfo', () => {
-	it( 'should be created properly', () => {
-		const EventInfo = modules.eventinfo;
+	let EventInfo;
+
+	before( () => {
+		EventInfo = modules[ 'core/eventinfo' ];
+	} );
 
+	it( 'should be created properly', () => {
 		let event = new EventInfo( this, 'test' );
 
 		expect( event.source ).to.equal( this );
@@ -20,8 +24,6 @@ describe( 'EventInfo', () => {
 	} );
 
 	it( 'should have stop() and off() marked', () => {
-		const EventInfo = modules.eventinfo;
-
 		let event = new EventInfo( this, 'test' );
 
 		event.stop();
@@ -32,8 +34,6 @@ describe( 'EventInfo', () => {
 	} );
 
 	it( 'should not mark "called" in future instances', () => {
-		const EventInfo = modules.eventinfo;
-
 		let event = new EventInfo( this, 'test' );
 
 		event.stop();

+ 4 - 3
packages/ckeditor5-utils/tests/log/log.js → packages/ckeditor5-utils/tests/log.js

@@ -7,10 +7,13 @@
 
 'use strict';
 
-const modules = bender.amd.require( 'log' );
+const modules = bender.amd.require( 'core/log' );
+let log;
 let spy;
 
 beforeEach( () => {
+	log = modules[ 'core/log' ];
+
 	if ( spy ) {
 		spy.restore();
 	}
@@ -18,7 +21,6 @@ beforeEach( () => {
 
 describe( 'warn()', () => {
 	it( 'logs the message to the console using console.warn()', () => {
-		let log = modules.log;
 		let spy = sinon.stub( console, 'warn' );
 		let data = { bar: 1 };
 
@@ -35,7 +37,6 @@ describe( 'warn()', () => {
 
 describe( 'error()', () => {
 	it( 'logs the message to the console using console.error()', () => {
-		let log = modules.log;
 		let spy = sinon.stub( console, 'error' );
 		let data = { bar: 1 };
 

+ 0 - 25
packages/ckeditor5-utils/tests/plugin/plugin.js

@@ -1,25 +0,0 @@
-/**
- * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const modules = bender.amd.require( 'plugin', 'editor' );
-let editor;
-
-before( () => {
-	const Editor = modules.editor;
-
-	editor = new Editor( document.body.appendChild( document.createElement( 'div' ) ) );
-} );
-
-describe( 'constructor', () => {
-	it( 'should set the `editor` property', () => {
-		const Plugin = modules.plugin;
-
-		let plugin = new Plugin( editor );
-
-		expect( plugin ).to.have.property( 'editor' ).to.equal( editor );
-	} );
-} );