Browse Source

Use arrow functions.

Piotrek Koszuliński 10 years ago
parent
commit
9dcf1d29c1
53 changed files with 369 additions and 369 deletions
  1. 1 1
      packages/ckeditor5-utils/src/ckeditorerror.js
  2. 1 1
      packages/ckeditor5-utils/src/collection.js
  3. 1 1
      packages/ckeditor5-utils/src/config.js
  4. 2 2
      packages/ckeditor5-utils/src/document/attribute.js
  5. 1 1
      packages/ckeditor5-utils/src/document/character.js
  6. 1 1
      packages/ckeditor5-utils/src/document/document.js
  7. 1 1
      packages/ckeditor5-utils/src/document/element.js
  8. 1 1
      packages/ckeditor5-utils/src/document/node.js
  9. 1 1
      packages/ckeditor5-utils/src/document/nodelist.js
  10. 1 1
      packages/ckeditor5-utils/src/document/operation/changeoperation.js
  11. 1 1
      packages/ckeditor5-utils/src/document/operation/insertoperation.js
  12. 1 1
      packages/ckeditor5-utils/src/document/operation/moveoperation.js
  13. 1 1
      packages/ckeditor5-utils/src/document/operation/operation.js
  14. 1 1
      packages/ckeditor5-utils/src/document/operation/reinsertoperation.js
  15. 1 1
      packages/ckeditor5-utils/src/document/operation/removeoperation.js
  16. 1 1
      packages/ckeditor5-utils/src/document/position.js
  17. 1 1
      packages/ckeditor5-utils/src/document/positioniterator.js
  18. 1 1
      packages/ckeditor5-utils/src/document/range.js
  19. 1 1
      packages/ckeditor5-utils/src/document/rootelement.js
  20. 1 1
      packages/ckeditor5-utils/src/document/text.js
  21. 1 1
      packages/ckeditor5-utils/src/emittermixin.js
  22. 1 1
      packages/ckeditor5-utils/src/eventinfo.js
  23. 1 1
      packages/ckeditor5-utils/src/log.js
  24. 4 4
      packages/ckeditor5-utils/src/model.js
  25. 2 2
      packages/ckeditor5-utils/src/utils-lodash.js
  26. 3 3
      packages/ckeditor5-utils/src/utils.js
  27. 3 3
      packages/ckeditor5-utils/tests/_tools/tools.js
  28. 6 6
      packages/ckeditor5-utils/tests/bender/tools.js
  29. 19 19
      packages/ckeditor5-utils/tests/ckeditor/ckeditor.js
  30. 6 6
      packages/ckeditor5-utils/tests/ckeditorerror/ckeditorerror.js
  31. 28 28
      packages/ckeditor5-utils/tests/config/config.js
  32. 11 11
      packages/ckeditor5-utils/tests/document/attribute.js
  33. 5 5
      packages/ckeditor5-utils/tests/document/character.js
  34. 17 17
      packages/ckeditor5-utils/tests/document/document.js
  35. 14 14
      packages/ckeditor5-utils/tests/document/element.js
  36. 31 31
      packages/ckeditor5-utils/tests/document/node.js
  37. 13 13
      packages/ckeditor5-utils/tests/document/nodelist.js
  38. 18 18
      packages/ckeditor5-utils/tests/document/operation/changeoperation.js
  39. 10 10
      packages/ckeditor5-utils/tests/document/operation/insertoperation.js
  40. 18 18
      packages/ckeditor5-utils/tests/document/operation/moveoperation.js
  41. 6 6
      packages/ckeditor5-utils/tests/document/operation/reinsertoperation.js
  42. 7 7
      packages/ckeditor5-utils/tests/document/operation/removeoperation.js
  43. 17 17
      packages/ckeditor5-utils/tests/document/position.js
  44. 7 7
      packages/ckeditor5-utils/tests/document/positioniterator.js
  45. 9 9
      packages/ckeditor5-utils/tests/document/range.js
  46. 4 4
      packages/ckeditor5-utils/tests/document/rootelement.js
  47. 3 3
      packages/ckeditor5-utils/tests/document/text.js
  48. 34 34
      packages/ckeditor5-utils/tests/emittermixin/emittermixin.js
  49. 4 4
      packages/ckeditor5-utils/tests/eventinfo/eventinfo.js
  50. 5 5
      packages/ckeditor5-utils/tests/log/log.js
  51. 15 15
      packages/ckeditor5-utils/tests/mvc/model/model.js
  52. 3 3
      packages/ckeditor5-utils/tests/plugin/plugin.js
  53. 23 23
      packages/ckeditor5-utils/tests/utils/utils.js

+ 1 - 1
packages/ckeditor5-utils/src/ckeditorerror.js

@@ -17,7 +17,7 @@
  * @extends Error
  */
 
-CKEDITOR.define( function() {
+CKEDITOR.define( () => {
 	class CKEditorError extends Error {
 		/**
 		 * Creates an instance of the CKEditorError class.

+ 1 - 1
packages/ckeditor5-utils/src/collection.js

@@ -19,7 +19,7 @@
  * @mixins EventEmitter
  */
 
-CKEDITOR.define( [ 'emittermixin', 'ckeditorerror', 'utils' ], function( EmitterMixin, CKEditorError, utils ) {
+CKEDITOR.define( [ 'emittermixin', 'ckeditorerror', 'utils' ], ( EmitterMixin, CKEditorError, utils ) => {
 	class Collection {
 		/**
 		 * Creates a new Collection instance.

+ 1 - 1
packages/ckeditor5-utils/src/config.js

@@ -12,7 +12,7 @@
  * @extends Model
  */
 
-CKEDITOR.define( [ 'model', 'utils' ], function( Model, utils ) {
+CKEDITOR.define( [ 'model', 'utils' ], ( Model, utils ) => {
 	class Config extends Model {
 		/**
 		 * Creates an instance of the {@link Config} class.

+ 2 - 2
packages/ckeditor5-utils/src/document/attribute.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'utils' ], function( utils ) {
+CKEDITOR.define( [ 'utils' ], ( utils ) => {
 	/**
 	 * Attributes can store any additional information for nodes in the data model.
 	 *
@@ -56,7 +56,7 @@ CKEDITOR.define( [ 'utils' ], function( utils ) {
 					const sorted = {};
 
 					// Sort keys and fill up the sorted object.
-					Object.keys( value ).sort().forEach( function( key ) {
+					Object.keys( value ).sort().forEach( ( key ) => {
 						sorted[ key ] = value[ key ];
 					} );
 

+ 1 - 1
packages/ckeditor5-utils/src/document/character.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'document/node' ], function( Node ) {
+CKEDITOR.define( [ 'document/node' ], ( Node ) => {
 	/**
 	 * Data structure for character stored in the tree data model.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/document.js

@@ -11,7 +11,7 @@ CKEDITOR.define( [
 	'emittermixin',
 	'utils',
 	'ckeditorerror'
-], function( Element, RootElement, EmitterMixin, utils, CKEditorError ) {
+], ( Element, RootElement, EmitterMixin, utils, CKEditorError ) => {
 	const graveyardSymbol = Symbol( 'graveyard' );
 
 	/**

+ 1 - 1
packages/ckeditor5-utils/src/document/element.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'document/node', 'document/nodelist' ], function( Node, NodeList ) {
+CKEDITOR.define( [ 'document/node', 'document/nodelist' ], ( Node, NodeList ) => {
 	/**
 	 * Tree data model element.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/node.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'document/attribute', 'utils', 'ckeditorerror' ], function( Attribute, utils, CKEditorError ) {
+CKEDITOR.define( [ 'document/attribute', 'utils', 'ckeditorerror' ], ( Attribute, utils, CKEditorError ) => {
 	/**
 	 * Abstract document tree node class.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/nodelist.js

@@ -10,7 +10,7 @@ CKEDITOR.define( [
 	'document/text',
 	'document/node',
 	'utils'
-], function( Character, Text, Node, utils ) {
+], ( Character, Text, Node, utils ) => {
 	/**
 	 * List of nodes. It is used to represent multiple nodes with a given order, for example children of
 	 * {@link document.Element} object or nodes inserted using {@link document.operation.InsertOperation}.

+ 1 - 1
packages/ckeditor5-utils/src/document/operation/changeoperation.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'document/operation/operation', 'ckeditorerror' ], function( Operation, CKEditorError ) {
+CKEDITOR.define( [ 'document/operation/operation', 'ckeditorerror' ], ( Operation, CKEditorError ) => {
 	/**
 	 * Operation to change nodes' attribute. Using this class you can add, remove or change value of the attribute.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/operation/insertoperation.js

@@ -9,7 +9,7 @@ CKEDITOR.define( [
 	'document/operation/operation',
 	'document/nodelist',
 	'document/operation/removeoperation'
-], function( Operation, NodeList ) {
+], ( Operation, NodeList ) => {
 	/**
 	 * Operation to insert list of nodes on the given position in the tree data model.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/operation/moveoperation.js

@@ -10,7 +10,7 @@ CKEDITOR.define( [
 	'document/nodelist',
 	'ckeditorerror',
 	'utils'
-], function( Operation, NodeList, CKEditorError, utils ) {
+], ( Operation, NodeList, CKEditorError, utils ) => {
 	/**
 	 * Operation to move list of subsequent nodes from one position in the document to another.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/operation/operation.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [], function() {
+CKEDITOR.define( [], () => {
 	/**
 	 * Abstract base operation class.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/operation/reinsertoperation.js

@@ -8,7 +8,7 @@
 CKEDITOR.define( [
 	'document/operation/moveoperation',
 	'document/operation/removeoperation'
-], function( MoveOperation ) {
+], ( MoveOperation ) => {
 	/**
 	 * Operation to reinsert previously removed nodes back to the non-graveyard root.
 	 * This is basically {@link document.operation.MoveOperation} but it returns

+ 1 - 1
packages/ckeditor5-utils/src/document/operation/removeoperation.js

@@ -9,7 +9,7 @@ CKEDITOR.define( [
 	'document/operation/moveoperation',
 	'document/position',
 	'document/operation/reinsertoperation'
-], function( MoveOperation, Position ) {
+], ( MoveOperation, Position ) => {
 	/**
 	 * Operation to remove a range of nodes.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/position.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'utils', 'ckeditorerror' ], function( utils, CKEditorError ) {
+CKEDITOR.define( [ 'utils', 'ckeditorerror' ], ( utils, CKEditorError ) => {
 	/**
 	 * Position in the tree. Position is always located before or after a node.
 	 * See {@link #path} property for more information.

+ 1 - 1
packages/ckeditor5-utils/src/document/positioniterator.js

@@ -9,7 +9,7 @@ CKEDITOR.define( [
 	'document/character',
 	'document/element',
 	'document/position'
-], function( Character, Element, Position ) {
+], ( Character, Element, Position ) => {
 	const ELEMENT_ENTER = 0;
 	const ELEMENT_LEAVE = 1;
 	const CHARACTER = 2;

+ 1 - 1
packages/ckeditor5-utils/src/document/range.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'document/positioniterator' ], function( PositionIterator ) {
+CKEDITOR.define( [ 'document/positioniterator' ], ( PositionIterator ) => {
 	/**
 	 * Range class. Range is iterable.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/rootelement.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [ 'document/element' ], function( Element ) {
+CKEDITOR.define( [ 'document/element' ], ( Element ) => {
 	/**
 	 * Class for nodes that are roots of trees in tree data model.
 	 *

+ 1 - 1
packages/ckeditor5-utils/src/document/text.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-CKEDITOR.define( [], function() {
+CKEDITOR.define( [], () => {
 	/**
 	 * Data structure for text with attributes. Note that the `Text` is not a {@link document.Node},
 	 * because it will never be part of the document tree. {@link document.Character is a node}.

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

@@ -12,7 +12,7 @@
  * @singleton
  */
 
-CKEDITOR.define( [ 'eventinfo', 'utils' ], function( EventInfo, utils ) {
+CKEDITOR.define( [ 'eventinfo', 'utils' ], ( EventInfo, utils ) => {
 	const EmitterMixin = {
 		/**
 		 * Registers a callback function to be executed when an event is fired.

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

@@ -12,7 +12,7 @@
  * @class EventInfo
  */
 
-CKEDITOR.define( [ 'utils' ], function( utils ) {
+CKEDITOR.define( [ 'utils' ], ( utils ) => {
 	class EventInfo {
 		constructor( source, name ) {
 			/**

+ 1 - 1
packages/ckeditor5-utils/src/log.js

@@ -39,7 +39,7 @@
  * @singleton
  */
 
-CKEDITOR.define( function() {
+CKEDITOR.define( () => {
 	const log = {
 		/**
 		 * Logs an error to the console.

+ 4 - 4
packages/ckeditor5-utils/src/model.js

@@ -12,7 +12,7 @@
  * @mixins EventEmitter
  */
 
-CKEDITOR.define( [ 'emittermixin', 'ckeditorerror', 'utils' ], function( EmitterMixin, CKEditorError, utils ) {
+CKEDITOR.define( [ 'emittermixin', 'ckeditorerror', 'utils' ], ( EmitterMixin, CKEditorError, utils ) => {
 	class Model {
 		/**
 		 * Creates a new Model instance.
@@ -57,7 +57,7 @@ CKEDITOR.define( [ 'emittermixin', 'ckeditorerror', 'utils' ], function( Emitter
 		set( name, value ) {
 			// If the first parameter is an Object, we gonna interact through its properties.
 			if ( utils.isObject( name ) ) {
-				Object.keys( name ).forEach( function( attr ) {
+				Object.keys( name ).forEach( ( attr ) => {
 					this.set( attr, name[ attr ] );
 				}, this );
 
@@ -87,11 +87,11 @@ CKEDITOR.define( [ 'emittermixin', 'ckeditorerror', 'utils' ], function( Emitter
 				enumerable: true,
 				configurable: true,
 
-				get: function() {
+				get: () => {
 					return this._attributes[ name ];
 				},
 
-				set: function( value ) {
+				set: ( value ) => {
 					const oldValue = this._attributes[ name ];
 
 					if ( oldValue !== value ) {

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

@@ -13,7 +13,7 @@
 //
 // https://lodash.com/docs
 
-( function() {
+( () => {
 	// The list of Lo-Dash methods to include in "utils".
 	// It is mandatory to execute `grunt lodash` after changes to this list.
 	const lodashInclude = [
@@ -79,7 +79,7 @@
 	if ( typeof module == 'object' && module.exports ) {
 		module.exports = lodashInclude;
 	} else {
-		CKEDITOR.define( function() {
+		CKEDITOR.define( () => {
 			return lodashInclude;
 		} );
 	}

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

@@ -12,7 +12,7 @@
  * @singleton
  */
 
-CKEDITOR.define( [ 'utils-lodash', 'lib/lodash/lodash-ckeditor' ], function( lodashIncludes, lodash ) {
+CKEDITOR.define( [ 'utils-lodash', 'lib/lodash/lodash-ckeditor' ], ( lodashIncludes, lodash ) => {
 	const utils = {
 		/**
 		 * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.
@@ -35,10 +35,10 @@ CKEDITOR.define( [ 'utils-lodash', 'lib/lodash/lodash-ckeditor' ], function( lod
 		 *
 		 * @returns {Number} A number representing the id.
 		 */
-		uid: ( function() {
+		uid: ( () => {
 			let next = 1;
 
-			return function() {
+			return () => {
 				return next++;
 			};
 		} )(),

+ 3 - 3
packages/ckeditor5-utils/tests/_tools/tools.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-( function() {
+( () => {
 	bender.tools.core = {
 		/**
 		 * Defines CKEditor plugin which is a mock of an editor creator.
@@ -23,8 +23,8 @@
 		 * @param {Object} [proto] Prototype of the creator. Properties from the proto param will
 		 * be copied to the prototype of the creator.
 		 */
-		defineEditorCreatorMock: function( creatorName, proto ) {
-			CKEDITOR.define( 'plugin!creator-' + creatorName, [ 'creator' ], function( Creator ) {
+		defineEditorCreatorMock: ( creatorName, proto ) => {
+			CKEDITOR.define( 'plugin!creator-' + creatorName, [ 'creator' ], ( Creator ) => {
 				return mockCreator( Creator );
 			} );
 

+ 6 - 6
packages/ckeditor5-utils/tests/bender/tools.js

@@ -7,8 +7,8 @@
 
 'use strict';
 
-let createFn3 = function() {};
-let destroyFn3 = function() {};
+let createFn3 = () => {};
+let destroyFn3 = () => {};
 
 bender.tools.core.defineEditorCreatorMock( 'test1' );
 bender.tools.core.defineEditorCreatorMock( 'test2', {
@@ -24,8 +24,8 @@ const modules = bender.amd.require( 'creator', 'plugin!creator-test1', 'plugin!c
 
 ///////////////////
 
-describe( 'bender.tools.core.defineEditorCreatorMock()', function() {
-	it( 'should register all creators', function() {
+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' ];
@@ -36,14 +36,14 @@ describe( 'bender.tools.core.defineEditorCreatorMock()', function() {
 		expect( TestCreator3.prototype ).to.be.instanceof( Creator );
 	} );
 
-	it( 'should copy properties from the second argument', function() {
+	it( 'should copy properties from the second argument', () => {
 		const TestCreator = modules[ 'plugin!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', function() {
+	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' ];

+ 19 - 19
packages/ckeditor5-utils/tests/ckeditor/ckeditor.js

@@ -15,7 +15,7 @@ let editorConfig = { plugins: 'creator-test' };
 bender.tools.createSinonSandbox();
 bender.tools.core.defineEditorCreatorMock( 'test' );
 
-beforeEach( function() {
+beforeEach( () => {
 	const CKEDITOR = modules.ckeditor;
 
 	// Destroy all editor instances.
@@ -24,60 +24,60 @@ beforeEach( function() {
 	}
 } );
 
-describe( 'create', function() {
-	it( 'should return a promise', function() {
+describe( 'create', () => {
+	it( 'should return a promise', () => {
 		const CKEDITOR = modules.ckeditor;
 
 		expect( CKEDITOR.create( content, editorConfig ) ).to.be.instanceof( Promise );
 	} );
 
-	it( 'should create a new editor instance', function() {
+	it( 'should create a new editor instance', () => {
 		const CKEDITOR = modules.ckeditor;
 		const Editor = modules.editor;
 
-		return CKEDITOR.create( content, editorConfig ).then( function( editor ) {
+		return CKEDITOR.create( content, editorConfig ).then( ( editor ) => {
 			expect( editor ).to.be.instanceof( Editor );
 			expect( editor.element ).to.equal( content );
 		} );
 	} );
 
-	it( 'should create a new editor instance (using a selector)', function() {
+	it( 'should create a new editor instance (using a selector)', () => {
 		const CKEDITOR = modules.ckeditor;
 		const Editor = modules.editor;
 
-		return CKEDITOR.create( '.editor', editorConfig ).then( function( editor ) {
+		return CKEDITOR.create( '.editor', editorConfig ).then( ( editor ) => {
 			expect( editor ).to.be.instanceof( Editor );
 			expect( editor.element ).to.equal( document.querySelector( '.editor' ) );
 		} );
 	} );
 
-	it( 'should set configurations on the new editor', function() {
+	it( 'should set configurations on the new editor', () => {
 		const CKEDITOR = modules.ckeditor;
 
-		return CKEDITOR.create( content, { test: 1, plugins: 'creator-test' } ).then( function( editor ) {
+		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', function() {
+	it( 'should add the editor to the `instances` collection', () => {
 		const CKEDITOR = modules.ckeditor;
 
-		return CKEDITOR.create( content, editorConfig ).then( function( editor ) {
+		return CKEDITOR.create( content, editorConfig ).then( ( editor ) => {
 			expect( CKEDITOR.instances ).to.have.length( 1 );
 			expect( CKEDITOR.instances.get( 0 ) ).to.equal( editor );
 		} );
 	} );
 
-	it( 'should remove the editor from the `instances` collection on `destroy` event', function() {
+	it( 'should remove the editor from the `instances` collection on `destroy` event', () => {
 		const CKEDITOR = modules.ckeditor;
 		let editor1, editor2;
 
 		// Create the first editor.
-		return CKEDITOR.create( content, editorConfig ).then( function( editor ) {
+		return CKEDITOR.create( content, editorConfig ).then( ( editor ) => {
 			editor1 = editor;
 
 			// Create the second editor.
-			return CKEDITOR.create( '.editor', editorConfig ).then( function( editor ) {
+			return CKEDITOR.create( '.editor', editorConfig ).then( ( editor ) => {
 				editor2 = editor;
 
 				// It should have 2 editors.
@@ -95,14 +95,14 @@ describe( 'create', function() {
 		} );
 	} );
 
-	it( 'should be rejected on element not found', function() {
+	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( function() {
+		return CKEDITOR.create( '.undefined' ).then( () => {
 			throw new Error( 'It should not enter this function' );
-		} ).catch( function( error ) {
+		} ).catch( ( error ) => {
 			expect( error ).to.be.instanceof( Error );
 			expect( error.message ).to.equal( 'Element not found' );
 			// We need to make sure that create()'s execution is stopped.
@@ -112,8 +112,8 @@ describe( 'create', function() {
 	} );
 } );
 
-describe( 'config', function() {
-	it( 'should be an instance of Config', function() {
+describe( 'config', () => {
+	it( 'should be an instance of Config', () => {
 		const CKEDITOR = modules.ckeditor;
 		const Config = modules.config;
 

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

@@ -7,8 +7,8 @@
 
 const modules = bender.amd.require( 'ckeditorerror' );
 
-describe( 'CKEditorError', function() {
-	it( 'inherits from Error', function() {
+describe( 'CKEditorError', () => {
+	it( 'inherits from Error', () => {
 		const CKEditorError = modules.ckeditorerror;
 		let error = new CKEditorError( 'foo' );
 
@@ -16,14 +16,14 @@ describe( 'CKEditorError', function() {
 		expect( error ).to.be.an.instanceOf( CKEditorError );
 	} );
 
-	it( 'sets the name', function() {
+	it( 'sets the name', () => {
 		const CKEditorError = modules.ckeditorerror;
 		let error = new CKEditorError( 'foo' );
 
 		expect( error ).to.have.property( 'name', 'CKEditorError' );
 	} );
 
-	it( 'sets the message', function() {
+	it( 'sets the message', () => {
 		const CKEditorError = modules.ckeditorerror;
 		let error = new CKEditorError( 'foo' );
 
@@ -31,7 +31,7 @@ describe( 'CKEditorError', function() {
 		expect( error.data ).to.be.undefined;
 	} );
 
-	it( 'sets the message and data', function() {
+	it( 'sets the message and data', () => {
 		const CKEditorError = modules.ckeditorerror;
 		let data = { bar: 1 };
 		let error = new CKEditorError( 'foo', data );
@@ -40,7 +40,7 @@ describe( 'CKEditorError', function() {
 		expect( error ).to.have.property( 'data', data );
 	} );
 
-	it( 'appends stringified data to the message', function() {
+	it( 'appends stringified data to the message', () => {
 		class Foo {
 			constructor() {
 				this.x = 1;

+ 28 - 28
packages/ckeditor5-utils/tests/config/config.js

@@ -9,7 +9,7 @@ const modules = bender.amd.require( 'config' );
 
 let config;
 
-beforeEach( function() {
+beforeEach( () => {
 	const Config = modules.config;
 
 	config = new Config( {
@@ -26,8 +26,8 @@ beforeEach( function() {
 	} );
 } );
 
-describe( 'constructor', function() {
-	it( 'should set configurations', function() {
+describe( 'constructor', () => {
+	it( 'should set configurations', () => {
 		expect( config ).to.have.property( 'creator' ).to.equal( 'inline' );
 		expect( config ).to.have.property( 'language' ).to.equal( 'pl' );
 		expect( config ).to.have.property( 'resize' ).to.have.property( 'minheight' ).to.equal( 300 );
@@ -37,7 +37,7 @@ describe( 'constructor', function() {
 		expect( config ).to.have.property( 'toolbar' ).to.equal( 'top' );
 	} );
 
-	it( 'should work with no parameters', function() {
+	it( 'should work with no parameters', () => {
 		const Config = modules.config;
 
 		// No error should be thrown.
@@ -45,15 +45,15 @@ describe( 'constructor', function() {
 	} );
 } );
 
-describe( 'set', function() {
-	it( 'should create Config instances for objects', function() {
+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 );
 	} );
 
-	it( 'should set configurations when passing objects', function() {
+	it( 'should set configurations when passing objects', () => {
 		config.set( {
 			option1: 1,
 			option2: {
@@ -69,13 +69,13 @@ describe( 'set', function() {
 			.to.have.property( 'suboption21' ).to.equal( 21 );
 	} );
 
-	it( 'should set configurations when passing name and value', function() {
+	it( 'should set configurations when passing name and value', () => {
 		config.set( 'something', 'anything' );
 
 		expect( config ).to.have.property( 'something' ).to.equal( 'anything' );
 	} );
 
-	it( 'should set configurations when passing name.with.deep and value', function() {
+	it( 'should set configurations when passing name.with.deep and value', () => {
 		config.set( 'color.red', 'f00' );
 		config.set( 'background.color.blue', '00f' );
 
@@ -89,7 +89,7 @@ describe( 'set', function() {
 			.to.have.property( 'blue' ).to.equal( '00f' );
 	} );
 
-	it( 'should override and expand deep configurations', function() {
+	it( 'should override and expand deep configurations', () => {
 		config.set( {
 			resize: {
 				minHeight: 400,		// Override
@@ -111,7 +111,7 @@ describe( 'set', function() {
 		expect( config.resize.icon ).to.have.property( 'url' ).to.equal( true );
 	} );
 
-	it( 'should replace a simple entry with a Config instance', function() {
+	it( 'should replace a simple entry with a Config instance', () => {
 		const Config = modules.config;
 
 		config.set( 'test', 1 );
@@ -123,7 +123,7 @@ describe( 'set', function() {
 		expect( config.test.prop ).to.equal( 1 );
 	} );
 
-	it( 'should replace a simple entry with a Config instance when passing an object', function() {
+	it( 'should replace a simple entry with a Config instance when passing an object', () => {
 		const Config = modules.config;
 
 		config.set( 'test', 1 );
@@ -137,7 +137,7 @@ describe( 'set', function() {
 		expect( config.test.prop ).to.equal( 1 );
 	} );
 
-	it( 'should replace a simple entry with a Config instance when passing a name.with.deep', function() {
+	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 );
@@ -148,7 +148,7 @@ describe( 'set', function() {
 		expect( config.test.prop.value ).to.equal( 1 );
 	} );
 
-	it( 'should not create Config instances for non-pure objects', function() {
+	it( 'should not create Config instances for non-pure objects', () => {
 		function SomeClass() {}
 
 		config.set( 'date', new Date() );
@@ -160,7 +160,7 @@ describe( 'set', function() {
 		expect( config.instance ).to.be.an.instanceof( SomeClass );
 	} );
 
-	it( 'should set `null` for undefined value', function() {
+	it( 'should set `null` for undefined value', () => {
 		config.set( 'test' );
 
 		expect( config.test ).to.be.null();
@@ -168,17 +168,17 @@ describe( 'set', function() {
 	} );
 } );
 
-describe( 'get', function() {
-	it( 'should retrieve a configuration', function() {
+describe( 'get', () => {
+	it( 'should retrieve a configuration', () => {
 		expect( config.get( 'creator' ) ).to.equal( 'inline' );
 	} );
 
-	it( 'should retrieve a deep configuration', function() {
+	it( 'should retrieve a deep configuration', () => {
 		expect( config.get( 'resize.minheight' ) ).to.equal( 300 );
 		expect( config.get( 'resize.icon.path' ) ).to.equal( 'xyz' );
 	} );
 
-	it( 'should retrieve a subset of the configuration', function() {
+	it( 'should retrieve a subset of the configuration', () => {
 		let resizeConfig = config.get( 'resize' );
 
 		expect( resizeConfig ).to.have.property( 'minheight' ).to.equal( 300 );
@@ -190,24 +190,24 @@ describe( 'get', function() {
 		expect( iconConfig ).to.have.property( 'path' ).to.equal( 'xyz' );
 	} );
 
-	it( 'should retrieve values case-insensitively', function() {
+	it( 'should retrieve values case-insensitively', () => {
 		expect( config.get( 'Creator' ) ).to.equal( 'inline' );
 		expect( config.get( 'CREATOR' ) ).to.equal( 'inline' );
 		expect( config.get( 'resize.minHeight' ) ).to.equal( 300 );
 		expect( config.get( 'resize.MINHEIGHT' ) ).to.equal( 300 );
 	} );
 
-	it( 'should return undefined for non existing configuration', function() {
+	it( 'should return undefined for non existing configuration', () => {
 		expect( config.get( 'invalid' ) ).to.be.undefined();
 	} );
 
-	it( 'should return undefined for non existing deep configuration', function() {
+	it( 'should return undefined for non existing deep configuration', () => {
 		expect( config.get( 'resize.invalid.value' ) ).to.be.undefined();
 	} );
 } );
 
-describe( 'define', function() {
-	it( 'should create the definition property', function() {
+describe( 'define', () => {
+	it( 'should create the definition property', () => {
 		expect( config ).to.not.have.property( 'definition' );
 
 		config.define( 'test', 1 );
@@ -215,7 +215,7 @@ describe( 'define', function() {
 		expect( config ).to.have.property( 'definition' );
 	} );
 
-	it( 'should set configurations in the definition property', function() {
+	it( 'should set configurations in the definition property', () => {
 		config.define( 'test1', 1 );
 
 		// This is for Code Coverage to ensure that it works when `definition` is already defined.
@@ -225,7 +225,7 @@ describe( 'define', function() {
 		expect( config.definition ).to.have.property( 'test2' ).to.equal( 2 );
 	} );
 
-	it( 'should set configurations passed as object in the definition property', function() {
+	it( 'should set configurations passed as object in the definition property', () => {
 		config.define( {
 			test: 1
 		} );
@@ -233,14 +233,14 @@ describe( 'define', function() {
 		expect( config.definition ).to.have.property( 'test' ).to.equal( 1 );
 	} );
 
-	it( 'should not define main config properties but still be retrieved with get()', function() {
+	it( 'should not define main config properties but still be retrieved with get()', () => {
 		config.define( 'test', 1 );
 
 		expect( config ).to.not.have.property( 'test' );
 		expect( config.get( 'test' ) ).to.equal( 1 );
 	} );
 
-	it( 'should be overridden by set()', function() {
+	it( 'should be overridden by set()', () => {
 		config.define( 'test', 1 );
 		config.set( 'test', 2 );
 

+ 11 - 11
packages/ckeditor5-utils/tests/document/attribute.js

@@ -9,33 +9,33 @@
 
 const modules = bender.amd.require( 'document/attribute' );
 
-describe( 'Attribute', function() {
+describe( 'Attribute', () => {
 	let Attribute;
 
-	before( function() {
+	before( () => {
 		Attribute = modules[ 'document/attribute' ];
 	} );
 
-	beforeEach( function() {
+	beforeEach( () => {
 		Attribute._register = {};
 	} );
 
-	describe( 'constructor', function() {
-		it( 'should create attribute', function() {
+	describe( 'constructor', () => {
+		it( 'should create attribute', () => {
 			let attr = new Attribute( 'foo', 'bar' );
 
 			expect( attr ).to.have.property( 'key' ).that.equals( 'foo' );
 			expect( attr ).to.have.property( 'value' ).that.equals( 'bar' );
 		} );
 
-		it( 'should create equal instance even if object has different order', function() {
+		it( 'should create equal instance even if object has different order', () => {
 			let attr1 = new Attribute( 'foo', { a: 1, b: 2 } );
 			let attr2 = new Attribute( 'foo', { b: 2, a: 1 } );
 
 			expect( attr1.isEqual( attr2 ) ).to.be.true;
 		} );
 
-		it( 'should return the same object for registered objects', function() {
+		it( 'should return the same object for registered objects', () => {
 			Attribute.register( 'register', true );
 
 			let attr1 = new Attribute( 'register', true );
@@ -45,7 +45,7 @@ describe( 'Attribute', function() {
 			expect( attr1.isEqual( attr2 ) ).to.be.true;
 		} );
 
-		it( 'should return different objects for different values', function() {
+		it( 'should return different objects for different values', () => {
 			Attribute.register( 'register', true );
 
 			let attr1 = new Attribute( 'register', true );
@@ -55,7 +55,7 @@ describe( 'Attribute', function() {
 			expect( attr1.isEqual( attr2 ) ).to.not.be.true;
 		} );
 
-		it( 'should return different objects for not registered objects', function() {
+		it( 'should return different objects for not registered objects', () => {
 			Attribute.register( 'register', true );
 
 			let attr1 = new Attribute( 'register', false );
@@ -66,8 +66,8 @@ describe( 'Attribute', function() {
 		} );
 	} );
 
-	describe( 'register', function() {
-		it( 'Attribute.register should return registered attribute', function() {
+	describe( 'register', () => {
+		it( 'Attribute.register should return registered attribute', () => {
 			let attr1 = new Attribute( 'register', true );
 			let attr2 = Attribute.register( 'register', true );
 			let attr3 = Attribute.register( 'register', true );

+ 5 - 5
packages/ckeditor5-utils/tests/document/character.js

@@ -16,18 +16,18 @@ const modules = bender.amd.require(
 	'document/attribute'
 );
 
-describe( 'Character', function() {
+describe( 'Character', () => {
 	let Element, Character, Node, Attribute;
 
-	before( function() {
+	before( () => {
 		Element = modules[ 'document/element' ];
 		Character = modules[ 'document/character' ];
 		Node = modules[ 'document/node' ];
 		Attribute = modules[ 'document/attribute' ];
 	} );
 
-	describe( 'constructor', function() {
-		it( 'should create character without attributes', function() {
+	describe( 'constructor', () => {
+		it( 'should create character without attributes', () => {
 			let character = new Character( 'f' );
 			let parent = new Element( 'parent', [], character );
 
@@ -37,7 +37,7 @@ describe( 'Character', function() {
 			expect( character._getAttrCount() ).to.equal( 0 );
 		} );
 
-		it( 'should create character with attributes', function() {
+		it( 'should create character with attributes', () => {
 			let attr = new Attribute( 'foo', 'bar' );
 			let character = new Character( 'f', [ attr ] );
 			let parent = new Element( 'parent', [], character );

+ 17 - 17
packages/ckeditor5-utils/tests/document/document.js

@@ -13,10 +13,10 @@ const modules = bender.amd.require(
 	'ckeditorerror'
 );
 
-describe( 'Document', function() {
+describe( 'Document', () => {
 	let Document, RootElement, CKEditorError;
 
-	before( function() {
+	before( () => {
 		Document = modules[ 'document/document' ];
 		RootElement = modules[ 'document/rootelement' ];
 		CKEditorError = modules.ckeditorerror;
@@ -24,12 +24,12 @@ describe( 'Document', function() {
 
 	let document;
 
-	beforeEach( function() {
+	beforeEach( () => {
 		document = new Document();
 	} );
 
-	describe( 'constructor', function() {
-		it( 'should create Document with no data', function() {
+	describe( 'constructor', () => {
+		it( 'should create Document with no data', () => {
 			expect( document ).to.have.property( 'roots' ).that.is.instanceof( Map );
 			expect( document.roots.size ).to.equal( 1 );
 			expect( document._graveyard ).to.be.instanceof( RootElement );
@@ -37,8 +37,8 @@ describe( 'Document', function() {
 		} );
 	} );
 
-	describe( 'createRoot', function() {
-		it( 'should create a new RootElement, add it to roots map and return it', function() {
+	describe( 'createRoot', () => {
+		it( 'should create a new RootElement, add it to roots map and return it', () => {
 			let root = document.createRoot( 'root' );
 
 			expect( document.roots.size ).to.equal( 2 );
@@ -46,36 +46,36 @@ describe( 'Document', function() {
 			expect( root.getChildCount() ).to.equal( 0 );
 		} );
 
-		it( 'should throw an error when trying to create a second root with the same name', function() {
+		it( 'should throw an error when trying to create a second root with the same name', () => {
 			document.createRoot( 'root' );
 
 			expect(
-				function() {
+				() => {
 					document.createRoot( 'root' );
 				}
 			).to.throw( CKEditorError, /document-createRoot-name-exists/ );
 		} );
 	} );
 
-	describe( 'getRoot', function() {
-		it( 'should return a RootElement previously created with given name', function() {
+	describe( 'getRoot', () => {
+		it( 'should return a RootElement previously created with given name', () => {
 			let newRoot = document.createRoot( 'root' );
 			let getRoot = document.getRoot( 'root' );
 
 			expect( getRoot ).to.equal( newRoot );
 		} );
 
-		it( 'should throw an error when trying to get non-existent root', function() {
+		it( 'should throw an error when trying to get non-existent root', () => {
 			expect(
-				function() {
+				() => {
 					document.getRoot( 'root' );
 				}
 			).to.throw( CKEditorError, /document-createRoot-root-not-exist/ );
 		} );
 	} );
 
-	describe( 'applyOperation', function() {
-		it( 'should increase document version, execute operation and fire operationApplied', function() {
+	describe( 'applyOperation', () => {
+		it( 'should increase document version, execute operation and fire operationApplied', () => {
 			let operationApplied = sinon.spy();
 			let operation = {
 				baseVersion: 0,
@@ -91,7 +91,7 @@ describe( 'Document', function() {
 			sinon.assert.calledOnce( operation._execute );
 		} );
 
-		it( 'should throw an error on the operation base version and the document version is different', function() {
+		it( 'should throw an error on the operation base version and the document version is different', () => {
 			let operationApplied = sinon.spy();
 			let operation = {
 				baseVersion: 1
@@ -100,7 +100,7 @@ describe( 'Document', function() {
 			document.on( 'operationApplied', operationApplied );
 
 			expect(
-				function() {
+				() => {
 					document.applyOperation( operation );
 				}
 			).to.throw( CKEditorError, /document-applyOperation-wrong-version/ );

+ 14 - 14
packages/ckeditor5-utils/tests/document/element.js

@@ -16,18 +16,18 @@ const modules = bender.amd.require(
 	'document/attribute'
 );
 
-describe( 'Element', function() {
+describe( 'Element', () => {
 	let Element, Node, NodeList, Attribute;
 
-	before( function() {
+	before( () => {
 		Element = modules[ 'document/element' ];
 		Node = modules[ 'document/node' ];
 		NodeList = modules[ 'document/nodelist' ];
 		Attribute = modules[ 'document/attribute' ];
 	} );
 
-	describe( 'constructor', function() {
-		it( 'should create element without attributes', function() {
+	describe( 'constructor', () => {
+		it( 'should create element without attributes', () => {
 			let element = new Element( 'elem' );
 			let parent = new Element( 'parent', [], [ element ] );
 
@@ -37,7 +37,7 @@ describe( 'Element', function() {
 			expect( element._getAttrCount() ).to.equal( 0 );
 		} );
 
-		it( 'should create element with attributes', function() {
+		it( 'should create element with attributes', () => {
 			let attr = new Attribute( 'foo', 'bar' );
 
 			let element = new Element( 'elem', [ attr ] );
@@ -50,7 +50,7 @@ describe( 'Element', function() {
 			expect( element.getAttr( attr.key ) ).to.equal( attr.value );
 		} );
 
-		it( 'should create element with children', function() {
+		it( 'should create element with children', () => {
 			let element = new Element( 'elem', [], 'foo' );
 
 			expect( element ).to.have.property( 'name' ).that.equals( 'elem' );
@@ -61,8 +61,8 @@ describe( 'Element', function() {
 		} );
 	} );
 
-	describe( 'insertChildren', function() {
-		it( 'should add children to the element', function() {
+	describe( 'insertChildren', () => {
+		it( 'should add children to the element', () => {
 			let element = new Element( 'elem', [], [ 'xy' ] );
 			element.insertChildren( 1, 'foo' );
 
@@ -76,8 +76,8 @@ describe( 'Element', function() {
 		} );
 	} );
 
-	describe( 'removeChildren', function() {
-		it( 'should remove children from the element and return them as a NodeList', function() {
+	describe( 'removeChildren', () => {
+		it( 'should remove children from the element and return them as a NodeList', () => {
 			let element = new Element( 'elem', [], [ 'foobar' ] );
 			let o = element.getChild( 2 );
 			let b = element.getChild( 3 );
@@ -101,8 +101,8 @@ describe( 'Element', function() {
 		} );
 	} );
 
-	describe( 'getChildIndex', function() {
-		it( 'should return child index', function() {
+	describe( 'getChildIndex', () => {
+		it( 'should return child index', () => {
 			let element = new Element( 'elem', [], [ 'bar' ] );
 			let b = element.getChild( 0 );
 			let a = element.getChild( 1 );
@@ -114,8 +114,8 @@ describe( 'Element', function() {
 		} );
 	} );
 
-	describe( 'getChildCount', function() {
-		it( 'should return number of children', function() {
+	describe( 'getChildCount', () => {
+		it( 'should return number of children', () => {
 			let element = new Element( 'elem', [], [ 'bar' ] );
 
 			expect( element.getChildCount() ).to.equal( 3 );

+ 31 - 31
packages/ckeditor5-utils/tests/document/node.js

@@ -15,14 +15,14 @@ const modules = bender.amd.require(
 	'ckeditorerror'
 );
 
-describe( 'Node', function() {
+describe( 'Node', () => {
 	let Element, Character, Attribute, NodeList, CKEditorError;
 
 	let root;
 	let one, two, three;
 	let charB, charA, charR, img;
 
-	before( function() {
+	before( () => {
 		Element = modules[ 'document/element' ];
 		Character = modules[ 'document/character' ];
 		Attribute = modules[ 'document/attribute' ];
@@ -41,8 +41,8 @@ describe( 'Node', function() {
 		root = new Element( null, null, [ one, two, three ] );
 	} );
 
-	describe( 'should have a correct property', function() {
-		it( 'depth', function() {
+	describe( 'should have a correct property', () => {
+		it( 'depth', () => {
 			expect( root ).to.have.property( 'depth' ).that.equals( 0 );
 
 			expect( one ).to.have.property( 'depth' ).that.equals( 1 );
@@ -55,7 +55,7 @@ describe( 'Node', function() {
 			expect( charR ).to.have.property( 'depth' ).that.equals( 2 );
 		} );
 
-		it( 'root', function() {
+		it( 'root', () => {
 			expect( root ).to.have.property( 'root' ).that.equals( root );
 
 			expect( one ).to.have.property( 'root' ).that.equals( root );
@@ -68,7 +68,7 @@ describe( 'Node', function() {
 			expect( charR ).to.have.property( 'root' ).that.equals( root );
 		} );
 
-		it( 'nextSibling', function() {
+		it( 'nextSibling', () => {
 			expect( root ).to.have.property( 'nextSibling' ).that.is.null;
 
 			expect( one ).to.have.property( 'nextSibling' ).that.equals( two );
@@ -81,7 +81,7 @@ describe( 'Node', function() {
 			expect( charR ).to.have.property( 'nextSibling' ).that.is.null;
 		} );
 
-		it( 'previousSibling', function() {
+		it( 'previousSibling', () => {
 			expect( root ).to.have.property( 'previousSibling' ).that.is.expect;
 
 			expect( one ).to.have.property( 'previousSibling' ).that.is.null;
@@ -95,8 +95,8 @@ describe( 'Node', function() {
 		} );
 	} );
 
-	describe( 'constructor', function() {
-		it( 'should copy attributes, not pass by reference', function() {
+	describe( 'constructor', () => {
+		it( 'should copy attributes, not pass by reference', () => {
 			let attrs = [ new Attribute( 'attr', true ) ];
 			let foo = new Element( 'foo', attrs );
 			let bar = new Element( 'bar', attrs );
@@ -108,25 +108,25 @@ describe( 'Node', function() {
 		} );
 	} );
 
-	describe( 'getAttr', function() {
+	describe( 'getAttr', () => {
 		let fooAttr, element;
 
-		beforeEach( function() {
+		beforeEach( () => {
 			fooAttr = new Attribute( 'foo', true );
 			element = new Element( 'foo', [ fooAttr ] );
 		} );
 
-		it( 'should be possible to get attribute by key', function() {
+		it( 'should be possible to get attribute by key', () => {
 			expect( element.getAttr( 'foo' ) ).to.equal( fooAttr.value );
 		} );
 
-		it( 'should return null if attribute was not found by key', function() {
+		it( 'should return null if attribute was not found by key', () => {
 			expect( element.getAttr( 'bar' ) ).to.be.null;
 		} );
 	} );
 
-	describe( 'setAttr', function() {
-		it( 'should insert an attribute', function() {
+	describe( 'setAttr', () => {
+		it( 'should insert an attribute', () => {
 			let element = new Element( 'elem' );
 			let attr = new Attribute( 'foo', 'bar' );
 
@@ -136,7 +136,7 @@ describe( 'Node', function() {
 			expect( element.getAttr( attr.key ) ).to.equal( attr.value );
 		} );
 
-		it( 'should overwrite attribute with the same key', function() {
+		it( 'should overwrite attribute with the same key', () => {
 			let oldAttr = new Attribute( 'foo', 'bar' );
 			let newAttr = new Attribute( 'foo', 'bar' );
 			let element = new Element( 'elem', [ oldAttr ] );
@@ -148,8 +148,8 @@ describe( 'Node', function() {
 		} );
 	} );
 
-	describe( 'removeAttr', function() {
-		it( 'should remove an attribute', function() {
+	describe( 'removeAttr', () => {
+		it( 'should remove an attribute', () => {
 			let attrA = new Attribute( 'a', 'A' );
 			let attrB = new Attribute( 'b', 'b' );
 			let attrC = new Attribute( 'c', 'C' );
@@ -164,22 +164,22 @@ describe( 'Node', function() {
 		} );
 	} );
 
-	describe( 'hasAttr', function() {
-		it( 'should check attribute by key', function() {
+	describe( 'hasAttr', () => {
+		it( 'should check attribute by key', () => {
 			let fooAttr = new Attribute( 'foo', true );
 			let element = new Element( 'foo', [ fooAttr ] );
 
 			expect( element.hasAttr( 'foo' ) ).to.be.true;
 		} );
 
-		it( 'should return false if attribute was not found by key', function() {
+		it( 'should return false if attribute was not found by key', () => {
 			let fooAttr = new Attribute( 'foo', true );
 			let element = new Element( 'foo', [ fooAttr ] );
 
 			expect( element.hasAttr( 'bar' ) ).to.be.false;
 		} );
 
-		it( 'should check attribute by object', function() {
+		it( 'should check attribute by object', () => {
 			let fooAttr = new Attribute( 'foo', true );
 			let foo2Attr = new Attribute( 'foo', true );
 			let element = new Element( 'foo', [ fooAttr ] );
@@ -187,14 +187,14 @@ describe( 'Node', function() {
 			expect( element.hasAttr( foo2Attr ) ).to.be.true;
 		} );
 
-		it( 'should return false if attribute was not found by object', function() {
+		it( 'should return false if attribute was not found by object', () => {
 			let fooAttr = new Attribute( 'foo', true );
 			let element = new Element( 'foo' );
 
 			expect( element.hasAttr( fooAttr ) ).to.be.false;
 		} );
 
-		it( 'should create proper JSON string using toJSON method', function() {
+		it( 'should create proper JSON string using toJSON method', () => {
 			let b = new Character( 'b' );
 			let foo = new Element( 'foo', [], [ b ] );
 
@@ -206,12 +206,12 @@ describe( 'Node', function() {
 		} );
 	} );
 
-	describe( 'getIndex', function() {
-		it( 'should return null if the parent is null', function() {
+	describe( 'getIndex', () => {
+		it( 'should return null if the parent is null', () => {
 			expect( root.getIndex() ).to.be.null;
 		} );
 
-		it( 'should return index in the parent', function() {
+		it( 'should return index in the parent', () => {
 			expect( one.getIndex() ).to.equal( 0 );
 			expect( two.getIndex() ).to.equal( 1 );
 			expect( three.getIndex() ).to.equal( 2 );
@@ -222,22 +222,22 @@ describe( 'Node', function() {
 			expect( charR.getIndex() ).to.equal( 3 );
 		} );
 
-		it( 'should throw an error if parent does not contains element', function() {
+		it( 'should throw an error if parent does not contains element', () => {
 			let f = new Character( 'f' );
 			let bar = new Element( 'bar', [], [] );
 
 			f.parent = bar;
 
 			expect(
-				function() {
+				() => {
 					f.getIndex();
 				}
 			).to.throw( CKEditorError, /node-not-found-in-parent/ );
 		} );
 	} );
 
-	describe( 'getPath', function() {
-		it( 'should return proper path', function() {
+	describe( 'getPath', () => {
+		it( 'should return proper path', () => {
 			expect( root.getPath() ).to.deep.equal( [] );
 
 			expect( one.getPath() ).to.deep.equal( [ 0 ] );

+ 13 - 13
packages/ckeditor5-utils/tests/document/nodelist.js

@@ -14,18 +14,18 @@ const modules = bender.amd.require(
 	'document/attribute'
 );
 
-describe( 'NodeList', function() {
+describe( 'NodeList', () => {
 	let NodeList, Character, Text, Attribute;
 
-	before( function() {
+	before( () => {
 		NodeList = modules[ 'document/nodelist' ];
 		Character = modules[ 'document/character' ];
 		Text = modules[ 'document/text' ];
 		Attribute = modules[ 'document/attribute' ];
 	} );
 
-	describe( 'constructor', function() {
-		it( 'should change array of strings into a set of nodes', function() {
+	describe( 'constructor', () => {
+		it( 'should change array of strings into a set of nodes', () => {
 			let nodeList = new NodeList( [ 'foo', new Character( 'x' ), 'bar' ] );
 
 			expect( nodeList.length ).to.equal( 7 );
@@ -38,7 +38,7 @@ describe( 'NodeList', function() {
 			expect( nodeList.get( 6 ).character ).to.equal( 'r' );
 		} );
 
-		it( 'should change string into a set of nodes', function() {
+		it( 'should change string into a set of nodes', () => {
 			let nodeList = new NodeList( 'foo' );
 
 			expect( nodeList.length ).to.equal( 3 );
@@ -47,14 +47,14 @@ describe( 'NodeList', function() {
 			expect( nodeList.get( 2 ).character ).to.equal( 'o' );
 		} );
 
-		it( 'should change node into a set of nodes', function() {
+		it( 'should change node into a set of nodes', () => {
 			let nodeList = new NodeList( new Character( 'x' ) );
 
 			expect( nodeList.length ).to.equal( 1 );
 			expect( nodeList.get( 0 ).character ).to.equal( 'x' );
 		} );
 
-		it( 'should change text with attribute into a set of nodes', function() {
+		it( 'should change text with attribute into a set of nodes', () => {
 			let attr = new Attribute( 'bold', true );
 			let nodeList = new NodeList( new Text( 'foo', [ attr ] ) );
 
@@ -68,8 +68,8 @@ describe( 'NodeList', function() {
 		} );
 	} );
 
-	describe( 'insert', function() {
-		it( 'should insert one nodelist into another', function() {
+	describe( 'insert', () => {
+		it( 'should insert one nodelist into another', () => {
 			let outerList = new NodeList( 'foo' );
 			let innerList = new NodeList( 'xxx' );
 
@@ -85,8 +85,8 @@ describe( 'NodeList', function() {
 		} );
 	} );
 
-	describe( 'remove', function() {
-		it( 'should remove part of the nodelist', function() {
+	describe( 'remove', () => {
+		it( 'should remove part of the nodelist', () => {
 			let nodeList = new NodeList( 'foobar' );
 
 			nodeList.remove( 2, 3 );
@@ -98,8 +98,8 @@ describe( 'NodeList', function() {
 		} );
 	} );
 
-	describe( 'iterator', function() {
-		it( 'should iterate over all elements in the collection', function() {
+	describe( 'iterator', () => {
+		it( 'should iterate over all elements in the collection', () => {
 			let characters = 'foo';
 			let nodeList = new NodeList( characters );
 			let i = 0;

+ 18 - 18
packages/ckeditor5-utils/tests/document/operation/changeoperation.js

@@ -19,10 +19,10 @@ const modules = bender.amd.require(
 	'ckeditorerror'
 );
 
-describe( 'ChangeOperation', function() {
+describe( 'ChangeOperation', () => {
 	let Document, ChangeOperation, Position, Range, Character, Attribute, NodeList, Text, CKEditorError;
 
-	before( function() {
+	before( () => {
 		Document = modules[ 'document/document' ];
 		ChangeOperation = modules[ 'document/operation/changeoperation' ];
 		Position = modules[ 'document/position' ];
@@ -36,12 +36,12 @@ describe( 'ChangeOperation', function() {
 
 	let doc, root;
 
-	beforeEach( function() {
+	beforeEach( () => {
 		doc = new Document();
 		root = doc.createRoot( 'root' );
 	} );
 
-	it( 'should insert attribute to the set of nodes', function() {
+	it( 'should insert attribute to the set of nodes', () => {
 		let newAttr = new Attribute( 'isNew', true );
 
 		root.insertChildren( 0, 'bar' );
@@ -62,7 +62,7 @@ describe( 'ChangeOperation', function() {
 		expect( root.getChild( 2 )._getAttrCount() ).to.equal( 0 );
 	} );
 
-	it( 'should add attribute to the existing attributes', function() {
+	it( 'should add attribute to the existing attributes', () => {
 		let newAttr = new Attribute( 'isNew', true );
 		let fooAttr = new Attribute( 'foo', true );
 		let barAttr = new Attribute( 'bar', true );
@@ -86,7 +86,7 @@ describe( 'ChangeOperation', function() {
 		expect( root.getChild( 0 ).hasAttr( barAttr ) ).to.be.true;
 	} );
 
-	it( 'should change attribute to the set of nodes', function() {
+	it( 'should change attribute to the set of nodes', () => {
 		let oldAttr = new Attribute( 'isNew', false );
 		let newAttr = new Attribute( 'isNew', true );
 
@@ -111,7 +111,7 @@ describe( 'ChangeOperation', function() {
 		expect( root.getChild( 2 ).hasAttr( oldAttr ) ).to.be.true;
 	} );
 
-	it( 'should change attribute in the middle of existing attributes', function() {
+	it( 'should change attribute in the middle of existing attributes', () => {
 		let fooAttr = new Attribute( 'foo', true );
 		let x1Attr = new Attribute( 'x', 1 );
 		let x2Attr = new Attribute( 'x', 2 );
@@ -136,7 +136,7 @@ describe( 'ChangeOperation', function() {
 		expect( root.getChild( 0 ).hasAttr( barAttr ) ).to.be.true;
 	} );
 
-	it( 'should remove attribute', function() {
+	it( 'should remove attribute', () => {
 		let fooAttr = new Attribute( 'foo', true );
 		let xAttr = new Attribute( 'x', true );
 		let barAttr = new Attribute( 'bar', true );
@@ -159,7 +159,7 @@ describe( 'ChangeOperation', function() {
 		expect( root.getChild( 0 ).hasAttr( barAttr ) ).to.be.true;
 	} );
 
-	it( 'should create a change operation as a reverse', function() {
+	it( 'should create a change operation as a reverse', () => {
 		let oldAttr = new Attribute( 'x', 'old' );
 		let newAttr = new Attribute( 'x', 'new' );
 		let range = new Range( new Position( [ 0 ], root ), new Position( [ 3 ], root ) );
@@ -173,7 +173,7 @@ describe( 'ChangeOperation', function() {
 		expect( reverse.newAttr ).to.equal( oldAttr );
 	} );
 
-	it( 'should undo adding attribute by applying reverse operation', function() {
+	it( 'should undo adding attribute by applying reverse operation', () => {
 		let newAttr = new Attribute( 'isNew', true );
 
 		root.insertChildren( 0, 'bar' );
@@ -197,7 +197,7 @@ describe( 'ChangeOperation', function() {
 		expect( root.getChild( 2 )._getAttrCount() ).to.equal( 0 );
 	} );
 
-	it( 'should undo changing attribute by applying reverse operation', function() {
+	it( 'should undo changing attribute by applying reverse operation', () => {
 		let oldAttr = new Attribute( 'isNew', false );
 		let newAttr = new Attribute( 'isNew', true );
 
@@ -226,7 +226,7 @@ describe( 'ChangeOperation', function() {
 		expect( root.getChild( 2 ).hasAttr( oldAttr ) ).to.be.true;
 	} );
 
-	it( 'should undo remove attribute by applying reverse operation', function() {
+	it( 'should undo remove attribute by applying reverse operation', () => {
 		let fooAttr = new Attribute( 'foo', false );
 
 		root.insertChildren( 0, new Text( 'bar', [ fooAttr ] ) );
@@ -254,13 +254,13 @@ describe( 'ChangeOperation', function() {
 		expect( root.getChild( 2 ).hasAttr( fooAttr ) ).to.be.true;
 	} );
 
-	it( 'should throw an error when one try to remove and the attribute does not exists', function() {
+	it( 'should throw an error when one try to remove and the attribute does not exists', () => {
 		let fooAttr = new Attribute( 'foo', true );
 
 		root.insertChildren( 0, 'x' );
 
 		expect(
-			function() {
+			() => {
 				doc.applyOperation(
 					new ChangeOperation(
 						new Range( new Position( [ 0 ], root ), new Position( [ 1 ], root ) ),
@@ -273,14 +273,14 @@ describe( 'ChangeOperation', function() {
 		).to.throw( CKEditorError, /operation-change-no-attr-to-remove/ );
 	} );
 
-	it( 'should throw an error when one try to insert and the attribute already exists', function() {
+	it( 'should throw an error when one try to insert and the attribute already exists', () => {
 		let x1Attr = new Attribute( 'x', 1 );
 		let x2Attr = new Attribute( 'x', 2 );
 
 		root.insertChildren( 0, new Character( 'x', [ x1Attr ] ) );
 
 		expect(
-			function() {
+			() => {
 				doc.applyOperation(
 					new ChangeOperation(
 						new Range( new Position( [ 0 ], root ), new Position( [ 1 ], root ) ),
@@ -293,14 +293,14 @@ describe( 'ChangeOperation', function() {
 		).to.throw( CKEditorError, /operation-change-attr-exists/ );
 	} );
 
-	it( 'should throw an error when one try to change and the new and old attributes have different keys', function() {
+	it( 'should throw an error when one try to change and the new and old attributes have different keys', () => {
 		let fooAttr = new Attribute( 'foo', true );
 		let barAttr = new Attribute( 'bar', true );
 
 		root.insertChildren( 0, 'x' );
 
 		expect(
-			function() {
+			() => {
 				doc.applyOperation(
 					new ChangeOperation(
 						new Range( new Position( [ 0 ], root ), new Position( [ 1 ], root ) ),

+ 10 - 10
packages/ckeditor5-utils/tests/document/operation/insertoperation.js

@@ -16,10 +16,10 @@ const modules = bender.amd.require(
 	'document/nodelist'
 );
 
-describe( 'InsertOperation', function() {
+describe( 'InsertOperation', () => {
 	let Document, InsertOperation, RemoveOperation, Position, Character;
 
-	before( function() {
+	before( () => {
 		Document = modules[ 'document/document' ];
 		InsertOperation = modules[ 'document/operation/insertoperation' ];
 		RemoveOperation = modules[ 'document/operation/removeoperation' ];
@@ -29,12 +29,12 @@ describe( 'InsertOperation', function() {
 
 	let doc, root;
 
-	beforeEach( function() {
+	beforeEach( () => {
 		doc = new Document();
 		root = doc.createRoot( 'root' );
 	} );
 
-	it( 'should insert node', function() {
+	it( 'should insert node', () => {
 		doc.applyOperation(
 			new InsertOperation(
 				new Position( [ 0 ], root ),
@@ -48,7 +48,7 @@ describe( 'InsertOperation', function() {
 		expect( root.getChild( 0 ).character ).to.equal( 'x' );
 	} );
 
-	it( 'should insert set of nodes', function() {
+	it( 'should insert set of nodes', () => {
 		doc.applyOperation(
 			new InsertOperation(
 				new Position( [ 0 ], root ),
@@ -64,7 +64,7 @@ describe( 'InsertOperation', function() {
 		expect( root.getChild( 2 ).character ).to.equal( 'r' );
 	} );
 
-	it( 'should insert between existing nodes', function() {
+	it( 'should insert between existing nodes', () => {
 		root.insertChildren( 0, 'xy' );
 
 		doc.applyOperation(
@@ -84,7 +84,7 @@ describe( 'InsertOperation', function() {
 		expect( root.getChild( 4 ).character ).to.equal( 'y' );
 	} );
 
-	it( 'should insert text', function() {
+	it( 'should insert text', () => {
 		doc.applyOperation(
 			new InsertOperation(
 				new Position( [ 0 ], root ),
@@ -104,7 +104,7 @@ describe( 'InsertOperation', function() {
 		expect( root.getChild( 6 ).character ).to.equal( 'r' );
 	} );
 
-	it( 'should create a remove operation as a reverse', function() {
+	it( 'should create a remove operation as a reverse', () => {
 		let position = new Position( [ 0 ], root );
 		let operation = new InsertOperation(
 			position,
@@ -120,7 +120,7 @@ describe( 'InsertOperation', function() {
 		expect( reverse.howMany ).to.equal( 7 );
 	} );
 
-	it( 'should undo insert node by applying reverse operation', function() {
+	it( 'should undo insert node by applying reverse operation', () => {
 		let operation = new InsertOperation(
 			new Position( [ 0 ], root ),
 			new Character( 'x' ),
@@ -139,7 +139,7 @@ describe( 'InsertOperation', function() {
 		expect( root.getChildCount() ).to.equal( 0 );
 	} );
 
-	it( 'should undo insert set of nodes by applying reverse operation', function() {
+	it( 'should undo insert set of nodes by applying reverse operation', () => {
 		let operation = new InsertOperation(
 			new Position( [ 0 ], root ),
 			'bar',

+ 18 - 18
packages/ckeditor5-utils/tests/document/operation/moveoperation.js

@@ -16,10 +16,10 @@ const modules = bender.amd.require(
 	'ckeditorerror'
 );
 
-describe( 'MoveOperation', function() {
+describe( 'MoveOperation', () => {
 	let Document, MoveOperation, Position, Element, NodeList, CKEditorError;
 
-	before( function() {
+	before( () => {
 		Document = modules[ 'document/document' ];
 		MoveOperation = modules[ 'document/operation/moveoperation' ];
 		Position = modules[ 'document/position' ];
@@ -30,12 +30,12 @@ describe( 'MoveOperation', function() {
 
 	let doc, root;
 
-	beforeEach( function() {
+	beforeEach( () => {
 		doc = new Document();
 		root = doc.createRoot( 'root' );
 	} );
 
-	it( 'should move from one node to another', function() {
+	it( 'should move from one node to another', () => {
 		let p1 = new Element( 'p1', [], new Element( 'x' ) );
 		let p2 = new Element( 'p2' );
 
@@ -59,7 +59,7 @@ describe( 'MoveOperation', function() {
 		expect( p2.getChild( 0 ).name ).to.equal( 'x' );
 	} );
 
-	it( 'should move position of children in one node backward', function() {
+	it( 'should move position of children in one node backward', () => {
 		root.insertChildren( 0, 'xbarx' );
 
 		doc.applyOperation(
@@ -80,7 +80,7 @@ describe( 'MoveOperation', function() {
 		expect( root.getChild( 4 ).character ).to.equal( 'x' );
 	} );
 
-	it( 'should move position of children in one node forward', function() {
+	it( 'should move position of children in one node forward', () => {
 		root.insertChildren( 0, 'xbarx' );
 
 		doc.applyOperation(
@@ -101,7 +101,7 @@ describe( 'MoveOperation', function() {
 		expect( root.getChild( 4 ).character ).to.equal( 'x' );
 	} );
 
-	it( 'should create a move operation as a reverse', function() {
+	it( 'should create a move operation as a reverse', () => {
 		let nodeList = new NodeList( 'bar' );
 
 		let sourcePosition = new Position( [ 0 ], root );
@@ -118,7 +118,7 @@ describe( 'MoveOperation', function() {
 		expect( reverse.targetPosition ).to.equal( sourcePosition );
 	} );
 
-	it( 'should undo move node by applying reverse operation', function() {
+	it( 'should undo move node by applying reverse operation', () => {
 		let p1 = new Element( 'p1', [], new Element( 'x' ) );
 		let p2 = new Element( 'p2' );
 
@@ -148,11 +148,11 @@ describe( 'MoveOperation', function() {
 		expect( p2.getChildCount() ).to.equal( 0 );
 	} );
 
-	it( 'should throw an error if number of nodes to move exceeds the number of existing nodes in given element', function() {
+	it( 'should throw an error if number of nodes to move exceeds the number of existing nodes in given element', () => {
 		root.insertChildren( 0, 'xbarx' );
 
 		expect(
-			function() {
+			() => {
 				doc.applyOperation(
 					new MoveOperation(
 						new Position( [ 3 ], root ),
@@ -165,7 +165,7 @@ describe( 'MoveOperation', function() {
 		).to.throw( CKEditorError, /operation-move-nodes-do-not-exist/ );
 	} );
 
-	it( 'should throw an error if target or source parent-element specified by position does not exist', function() {
+	it( 'should throw an error if target or source parent-element specified by position does not exist', () => {
 		let p = new Element( 'p' );
 		p.insertChildren( 0, 'foo' );
 		root.insertChildren( 0, [ 'ab', p ] );
@@ -180,13 +180,13 @@ describe( 'MoveOperation', function() {
 		root.removeChildren( 2, 1 );
 
 		expect(
-			function() {
+			() => {
 				doc.applyOperation( operation );
 			}
 		).to.throw( CKEditorError, /operation-move-position-invalid/ );
 	} );
 
-	it( 'should throw an error if operation tries to move a range between the beginning and the end of that range', function() {
+	it( 'should throw an error if operation tries to move a range between the beginning and the end of that range', () => {
 		root.insertChildren( 0, 'xbarx' );
 
 		let operation = new MoveOperation(
@@ -197,13 +197,13 @@ describe( 'MoveOperation', function() {
 		);
 
 		expect(
-			function() {
+			() => {
 				doc.applyOperation( operation );
 			}
 		).to.throw( CKEditorError, /operation-move-range-into-itself/ );
 	} );
 
-	it( 'should throw an error if operation tries to move a range into a sub-tree of a node that is in that range', function() {
+	it( 'should throw an error if operation tries to move a range into a sub-tree of a node that is in that range', () => {
 		let p = new Element( 'p', [], [ new Element( 'p' ) ] );
 		root.insertChildren( 0, [ 'ab', p, 'xy' ] );
 
@@ -215,13 +215,13 @@ describe( 'MoveOperation', function() {
 		);
 
 		expect(
-			function() {
+			() => {
 				doc.applyOperation( operation );
 			}
 		).to.throw( CKEditorError, /operation-move-node-into-itself/ );
 	} );
 
-	it( 'should not throw an error if operation move a range into a sibling', function() {
+	it( 'should not throw an error if operation move a range into a sibling', () => {
 		let p = new Element( 'p' );
 		root.insertChildren( 0, [ 'ab', p, 'xy' ] );
 
@@ -233,7 +233,7 @@ describe( 'MoveOperation', function() {
 		);
 
 		expect(
-			function() {
+			() => {
 				doc.applyOperation( operation );
 			}
 		).not.to.throw();

+ 6 - 6
packages/ckeditor5-utils/tests/document/operation/reinsertoperation.js

@@ -15,10 +15,10 @@ const modules = bender.amd.require(
 	'document/position'
 );
 
-describe( 'ReinsertOperation', function() {
+describe( 'ReinsertOperation', () => {
 	let Document, ReinsertOperation, RemoveOperation, MoveOperation, Position;
 
-	before( function() {
+	before( () => {
 		Document = modules[ 'document/document' ];
 		ReinsertOperation = modules[ 'document/operation/reinsertoperation' ];
 		RemoveOperation = modules[ 'document/operation/removeoperation' ];
@@ -28,7 +28,7 @@ describe( 'ReinsertOperation', function() {
 
 	let doc, root, graveyard, operation, graveyardPosition, rootPosition;
 
-	beforeEach( function() {
+	beforeEach( () => {
 		doc = new Document();
 		root = doc.createRoot( 'root' );
 		graveyard = doc._graveyard;
@@ -44,11 +44,11 @@ describe( 'ReinsertOperation', function() {
 		);
 	} );
 
-	it( 'should extend MoveOperation class', function() {
+	it( 'should extend MoveOperation class', () => {
 		expect( operation ).to.be.instanceof( MoveOperation );
 	} );
 
-	it( 'should create a remove operation as a reverse', function() {
+	it( 'should create a remove operation as a reverse', () => {
 		let reverse = operation.getReversed();
 
 		expect( reverse ).to.be.an.instanceof( RemoveOperation );
@@ -58,7 +58,7 @@ describe( 'ReinsertOperation', function() {
 		expect( reverse.targetPosition.isEqual( graveyardPosition ) ).to.be.true;
 	} );
 
-	it( 'should undo reinsert set of nodes by applying reverse operation', function() {
+	it( 'should undo reinsert set of nodes by applying reverse operation', () => {
 		let reverse = operation.getReversed();
 
 		graveyard.insertChildren( 0, 'bar' );

+ 7 - 7
packages/ckeditor5-utils/tests/document/operation/removeoperation.js

@@ -15,10 +15,10 @@ const modules = bender.amd.require(
 	'document/position'
 );
 
-describe( 'RemoveOperation', function() {
+describe( 'RemoveOperation', () => {
 	let Document, ReinsertOperation, RemoveOperation, MoveOperation, Position;
 
-	before( function() {
+	before( () => {
 		Document = modules[ 'document/document' ];
 		ReinsertOperation = modules[ 'document/operation/reinsertoperation' ];
 		RemoveOperation = modules[ 'document/operation/removeoperation' ];
@@ -28,13 +28,13 @@ describe( 'RemoveOperation', function() {
 
 	let doc, root, graveyard;
 
-	beforeEach( function() {
+	beforeEach( () => {
 		doc = new Document();
 		root = doc.createRoot( 'root' );
 		graveyard = doc._graveyard;
 	} );
 
-	it( 'should extend MoveOperation class', function() {
+	it( 'should extend MoveOperation class', () => {
 		let operation = new RemoveOperation(
 			new Position( [ 2 ], root ),
 			2,
@@ -44,7 +44,7 @@ describe( 'RemoveOperation', function() {
 		expect( operation ).to.be.instanceof( MoveOperation );
 	} );
 
-	it( 'should remove set of nodes and append them to graveyard root', function() {
+	it( 'should remove set of nodes and append them to graveyard root', () => {
 		root.insertChildren( 0, 'fozbar' );
 
 		let z = root.getChild( 2 );
@@ -68,7 +68,7 @@ describe( 'RemoveOperation', function() {
 		expect( graveyard.getChild( 1 ) ).to.equal( b );
 	} );
 
-	it( 'should create a reinsert operation as a reverse', function() {
+	it( 'should create a reinsert operation as a reverse', () => {
 		let position = new Position( [ 0 ], root );
 		let operation = new RemoveOperation( position, 2, 0 );
 		let reverse = operation.getReversed();
@@ -80,7 +80,7 @@ describe( 'RemoveOperation', function() {
 		expect( reverse.targetPosition ).to.equal( position );
 	} );
 
-	it( 'should undo remove set of nodes by applying reverse operation', function() {
+	it( 'should undo remove set of nodes by applying reverse operation', () => {
 		let position = new Position( [ 0 ], root );
 		let operation = new RemoveOperation( position, 3, 0 );
 		let reverse = operation.getReversed();

+ 17 - 17
packages/ckeditor5-utils/tests/document/position.js

@@ -16,7 +16,7 @@ const modules = bender.amd.require(
 	'document/nodelist'
 );
 
-describe( 'position', function() {
+describe( 'position', () => {
 	let Element, Character, Document, NodeList, Position, CKEditorError;
 
 	let doc, root, p, ul, li1, li2, f, o, z, b, a, r;
@@ -32,7 +32,7 @@ describe( 'position', function() {
 	//        |- b   Before: [ 1, 1, 0 ] After: [ 1, 1, 1 ]
 	//        |- a   Before: [ 1, 1, 1 ] After: [ 1, 1, 2 ]
 	//        |- r   Before: [ 1, 1, 2 ] After: [ 1, 1, 3 ]
-	before( function() {
+	before( () => {
 		Element = modules[ 'document/element' ];
 		Character = modules[ 'document/character' ];
 		Document = modules[ 'document/document' ];
@@ -63,14 +63,14 @@ describe( 'position', function() {
 		root.insertChildren( 0, [ p, ul ] );
 	} );
 
-	it( 'should create a position with path and document', function() {
+	it( 'should create a position with path and document', () => {
 		let position = new Position( [ 0 ], root );
 
 		expect( position ).to.have.property( 'path' ).that.deep.equals( [ 0 ] );
 		expect( position ).to.have.property( 'root' ).that.equals( root );
 	} );
 
-	it( 'should make positions form node and offset', function() {
+	it( 'should make positions form node and offset', () => {
 		expect( Position.createFromParentAndOffset( root, 0 ) ).to.have.property( 'path' ).that.deep.equals( [ 0 ] );
 		expect( Position.createFromParentAndOffset( root, 1 ) ).to.have.property( 'path' ).that.deep.equals( [ 1 ] );
 		expect( Position.createFromParentAndOffset( root, 2 ) ).to.have.property( 'path' ).that.deep.equals( [ 2 ] );
@@ -87,7 +87,7 @@ describe( 'position', function() {
 		expect( Position.createFromParentAndOffset( li1, 3 ) ).to.have.property( 'path' ).that.deep.equals( [ 1, 0, 3 ] );
 	} );
 
-	it( 'should make positions before elements', function() {
+	it( 'should make positions before elements', () => {
 		expect( Position.createBefore( p ) ).to.have.property( 'path' ).that.deep.equals( [ 0 ] );
 
 		expect( Position.createBefore( ul ) ).to.have.property( 'path' ).that.deep.equals( [ 1 ] );
@@ -105,15 +105,15 @@ describe( 'position', function() {
 		expect( Position.createBefore( r ) ).to.have.property( 'path' ).that.deep.equals( [ 1, 1, 2 ] );
 	} );
 
-	it( 'should throw error if one try to make positions before root', function() {
+	it( 'should throw error if one try to make positions before root', () => {
 		expect(
-			function() {
+			() => {
 				Position.createBefore( root );
 			}
 		).to.throw( CKEditorError, /position-before-root/ );
 	} );
 
-	it( 'should make positions after elements', function() {
+	it( 'should make positions after elements', () => {
 		expect( Position.createAfter( p ) ).to.have.property( 'path' ).that.deep.equals( [ 1 ] );
 
 		expect( Position.createAfter( ul ) ).to.have.property( 'path' ).that.deep.equals( [ 2 ] );
@@ -131,15 +131,15 @@ describe( 'position', function() {
 		expect( Position.createAfter( r ) ).to.have.property( 'path' ).that.deep.equals( [ 1, 1, 3 ] );
 	} );
 
-	it( 'should throw error if one try to make positions after root', function() {
+	it( 'should throw error if one try to make positions after root', () => {
 		expect(
-			function() {
+			() => {
 				Position.createAfter( root );
 			}
 		).to.throw( CKEditorError, /position-after-root/ );
 	} );
 
-	it( 'should have parent', function() {
+	it( 'should have parent', () => {
 		expect( new Position( [ 0 ], root ) ).to.have.property( 'parent' ).that.equals( root );
 		expect( new Position( [ 1 ], root ) ).to.have.property( 'parent' ).that.equals( root );
 		expect( new Position( [ 2 ], root ) ).to.have.property( 'parent' ).that.equals( root );
@@ -156,7 +156,7 @@ describe( 'position', function() {
 		expect( new Position( [ 1, 0, 3 ], root ) ).to.have.property( 'parent' ).that.equals( li1 );
 	} );
 
-	it( 'should have offset', function() {
+	it( 'should have offset', () => {
 		expect( new Position( [ 0 ], root ) ).to.have.property( 'offset' ).that.equals( 0 );
 		expect( new Position( [ 1 ], root ) ).to.have.property( 'offset' ).that.equals( 1 );
 		expect( new Position( [ 2 ], root ) ).to.have.property( 'offset' ).that.equals( 2 );
@@ -173,7 +173,7 @@ describe( 'position', function() {
 		expect( new Position( [ 1, 0, 3 ], root ) ).to.have.property( 'offset' ).that.equals( 3 );
 	} );
 
-	it( 'should have nodeBefore', function() {
+	it( 'should have nodeBefore', () => {
 		expect( new Position( [ 0 ], root ) ).to.have.property( 'nodeBefore' ).that.is.null;
 		expect( new Position( [ 1 ], root ) ).to.have.property( 'nodeBefore' ).that.equals( p );
 		expect( new Position( [ 2 ], root ) ).to.have.property( 'nodeBefore' ).that.equals( ul );
@@ -190,7 +190,7 @@ describe( 'position', function() {
 		expect( new Position( [ 1, 0, 3 ], root ) ).to.have.property( 'nodeBefore' ).that.equals( z );
 	} );
 
-	it( 'should have nodeAfter', function() {
+	it( 'should have nodeAfter', () => {
 		expect( new Position( [ 0 ], root ) ).to.have.property( 'nodeAfter' ).that.equals( p );
 		expect( new Position( [ 1 ], root ) ).to.have.property( 'nodeAfter' ).that.equals( ul );
 		expect( new Position( [ 2 ], root ) ).to.have.property( 'nodeAfter' ).that.is.null;
@@ -207,21 +207,21 @@ describe( 'position', function() {
 		expect( new Position( [ 1, 0, 3 ], root ) ).to.have.property( 'nodeAfter' ).that.is.null;
 	} );
 
-	it( 'should equals another position with the same path', function() {
+	it( 'should equals another position with the same path', () => {
 		let position = new Position( [ 1, 1, 2 ], root );
 		let samePosition = new Position( [ 1, 1, 2 ], root );
 
 		expect( position.isEqual( samePosition ) ).to.be.true;
 	} );
 
-	it( 'should not equals another position with the different path', function() {
+	it( 'should not equals another position with the different path', () => {
 		let position = new Position( [ 1, 1, 1 ], root );
 		let differentNode = new Position( [ 1, 2, 2 ], root );
 
 		expect( position.isEqual( differentNode ) ).to.be.false;
 	} );
 
-	it( 'should have proper parent path', function() {
+	it( 'should have proper parent path', () => {
 		let position = new Position( [ 1, 2, 3 ], root );
 
 		expect( position.getParentPath() ).to.deep.equal( [ 1, 2 ] );

+ 7 - 7
packages/ckeditor5-utils/tests/document/positioniterator.js

@@ -16,13 +16,13 @@ const modules = bender.amd.require(
 	'document/range'
 );
 
-describe( 'range iterator', function() {
+describe( 'range iterator', () => {
 	let Document, Element, Character, PositionIterator, Position, Range;
 	let ELEMENT_ENTER, ELEMENT_LEAVE, CHARACTER;
 
 	let doc, expectedItems, root, img1, paragraph, b, a, r, img2, x;
 
-	before( function() {
+	before( () => {
 		Document = modules[ 'document/document' ];
 		Element = modules[ 'document/element' ];
 		Character = modules[ 'document/character' ];
@@ -73,7 +73,7 @@ describe( 'range iterator', function() {
 		];
 	} );
 
-	it( 'should return next position', function() {
+	it( 'should return next position', () => {
 		let iterator = new PositionIterator( new Position( [ 0 ], root ) ); // beginning of root
 		let i, len;
 
@@ -83,7 +83,7 @@ describe( 'range iterator', function() {
 		expect( iterator.next() ).to.have.property( 'done' ).that.is.true;
 	} );
 
-	it( 'should return previous position', function() {
+	it( 'should return previous position', () => {
 		let iterator = new PositionIterator( new Position( [ 2 ], root ) ); // ending of root
 
 		for ( let i = expectedItems.length - 1; i >= 0; i-- ) {
@@ -92,7 +92,7 @@ describe( 'range iterator', function() {
 		expect( iterator.previous() ).to.have.property( 'done' ).that.is.true;
 	} );
 
-	it( 'should return next position in the boundaries', function() {
+	it( 'should return next position in the boundaries', () => {
 		let start = new Position( [ 1, 0 ], root ); // p, 0
 		let end = new Position( [ 1, 3, 0 ], root ); // img, 0
 
@@ -106,7 +106,7 @@ describe( 'range iterator', function() {
 		expect( iterator.next() ).to.have.property( 'done' ).that.is.true;
 	} );
 
-	it( 'should return previous position in the boundaries', function() {
+	it( 'should return previous position in the boundaries', () => {
 		let start = new Position( [ 1, 0 ], root ); // p, 0
 		let end = new Position( [ 1, 3, 0 ], root ); // img, 0
 
@@ -120,7 +120,7 @@ describe( 'range iterator', function() {
 		expect( iterator.previous() ).to.have.property( 'done' ).that.is.true;
 	} );
 
-	it( 'should return iterate over the range', function() {
+	it( 'should return iterate over the range', () => {
 		let start = new Position( [ 0 ], root ); // begging of root
 		let end = new Position( [ 2 ], root ); // ending of root
 		let range = new Range( start, end );

+ 9 - 9
packages/ckeditor5-utils/tests/document/range.js

@@ -12,10 +12,10 @@ const modules = bender.amd.require(
 	'document/position'
 );
 
-describe( 'Range', function() {
+describe( 'Range', () => {
 	let Range, Position, start, end;
 
-	before( function() {
+	before( () => {
 		Position = modules[ 'document/position' ];
 		Range = modules[ 'document/range' ];
 
@@ -25,19 +25,19 @@ describe( 'Range', function() {
 
 	let range;
 
-	beforeEach( function() {
+	beforeEach( () => {
 		range = new Range( start, end );
 	} );
 
-	describe( 'constructor', function() {
-		it( 'should create a range with given positions', function() {
+	describe( 'constructor', () => {
+		it( 'should create a range with given positions', () => {
 			expect( range ).to.have.property( 'start' ).that.equal( start );
 			expect( range ).to.have.property( 'end' ).that.equal( end );
 		} );
 	} );
 
-	describe( 'isEqual', function() {
-		it( 'should return true if the ranges are the same', function() {
+	describe( 'isEqual', () => {
+		it( 'should return true if the ranges are the same', () => {
 			let sameStart = new Position( [ 0 ] );
 			let sameEnd = new Position( [ 1 ] );
 
@@ -46,7 +46,7 @@ describe( 'Range', function() {
 			expect( range.isEqual( sameRange ) ).to.be.true;
 		} );
 
-		it( 'should return false if the start position is different', function() {
+		it( 'should return false if the start position is different', () => {
 			let range = new Range( start, end );
 
 			let diffStart = new Position( [ 1 ] );
@@ -57,7 +57,7 @@ describe( 'Range', function() {
 			expect( range.isEqual( diffRange ) ).to.not.be.true;
 		} );
 
-		it( 'should return false if the end position is different', function() {
+		it( 'should return false if the end position is different', () => {
 			let sameStart = new Position( [ 0 ] );
 			let diffEnd = new Position( [ 0 ] );
 

+ 4 - 4
packages/ckeditor5-utils/tests/document/rootelement.js

@@ -15,17 +15,17 @@ const modules = bender.amd.require(
 	'document/rootelement'
 );
 
-describe( 'Element', function() {
+describe( 'Element', () => {
 	let Document, Element, RootElement;
 
-	before( function() {
+	before( () => {
 		Document = modules[ 'document/document' ];
 		Element = modules[ 'document/element' ];
 		RootElement = modules[ 'document/rootelement' ];
 	} );
 
-	describe( 'constructor', function() {
-		it( 'should create root element without attributes', function() {
+	describe( 'constructor', () => {
+		it( 'should create root element without attributes', () => {
 			let doc = new Document();
 			let root = new RootElement( doc );
 

+ 3 - 3
packages/ckeditor5-utils/tests/document/text.js

@@ -14,9 +14,9 @@ const modules = bender.amd.require(
 	'document/attribute'
 );
 
-describe( 'Text', function() {
-	describe( 'constructor', function() {
-		it( 'should create character without attributes', function() {
+describe( 'Text', () => {
+	describe( 'constructor', () => {
+		it( 'should create character without attributes', () => {
 			const Text = modules[ 'document/text' ];
 			const Attribute = modules[ 'document/attribute' ];
 

+ 34 - 34
packages/ckeditor5-utils/tests/emittermixin/emittermixin.js

@@ -11,8 +11,8 @@ let emitter, listener;
 
 beforeEach( refreshEmitter );
 
-describe( 'fire', function() {
-	it( 'should execute callbacks in the right order without priority', function() {
+describe( 'fire', () => {
+	it( 'should execute callbacks in the right order without priority', () => {
 		let spy1 = sinon.spy().named( 1 );
 		let spy2 = sinon.spy().named( 2 );
 		let spy3 = sinon.spy().named( 3 );
@@ -26,7 +26,7 @@ describe( 'fire', function() {
 		sinon.assert.callOrder( spy1, spy2, spy3 );
 	} );
 
-	it( 'should execute callbacks in the right order with priority defined', function() {
+	it( 'should execute callbacks in the right order with priority defined', () => {
 		let spy1 = sinon.spy().named( 1 );
 		let spy2 = sinon.spy().named( 2 );
 		let spy3 = sinon.spy().named( 3 );
@@ -44,7 +44,7 @@ describe( 'fire', function() {
 		sinon.assert.callOrder( spy1, spy2, spy3, spy4, spy5 );
 	} );
 
-	it( 'should pass arguments to callbacks', function() {
+	it( 'should pass arguments to callbacks', () => {
 		const EventInfo = modules.eventinfo;
 
 		let spy1 = sinon.spy();
@@ -59,7 +59,7 @@ describe( 'fire', function() {
 		sinon.assert.calledWithExactly( spy2, sinon.match.instanceOf( EventInfo ), 1, 'b', true );
 	} );
 
-	it( 'should pass proper context to callbacks', function() {
+	it( 'should pass proper context to callbacks', () => {
 		let ctx1 = {};
 		let ctx2 = {};
 
@@ -78,7 +78,7 @@ describe( 'fire', function() {
 		sinon.assert.calledOn( spy3, emitter );
 	} );
 
-	it( 'should fire the right event', function() {
+	it( 'should fire the right event', () => {
 		let spy1 = sinon.spy();
 		let spy2 = sinon.spy();
 
@@ -91,7 +91,7 @@ describe( 'fire', function() {
 		sinon.assert.called( spy2 );
 	} );
 
-	it( 'should execute callbacks many times', function() {
+	it( 'should execute callbacks many times', () => {
 		let spy = sinon.spy();
 
 		emitter.on( 'test', spy );
@@ -103,11 +103,11 @@ describe( 'fire', function() {
 		sinon.assert.calledThrice( spy );
 	} );
 
-	it( 'should do nothing for a non listened event', function() {
+	it( 'should do nothing for a non listened event', () => {
 		emitter.fire( 'test' );
 	} );
 
-	it( 'should accept the same callback many times', function() {
+	it( 'should accept the same callback many times', () => {
 		let spy = sinon.spy();
 
 		emitter.on( 'test', spy );
@@ -120,11 +120,11 @@ describe( 'fire', function() {
 	} );
 } );
 
-describe( 'on', function() {
-	it( 'should stop()', function() {
+describe( 'on', () => {
+	it( 'should stop()', () => {
 		let spy1 = sinon.spy();
 		let spy2 = sinon.spy();
-		let spy3 = sinon.spy( function( event ) {
+		let spy3 = sinon.spy( ( event ) => {
 			event.stop();
 		} );
 
@@ -141,9 +141,9 @@ describe( 'on', function() {
 		sinon.assert.called( spy3 );
 	} );
 
-	it( 'should take a callback off()', function() {
+	it( 'should take a callback off()', () => {
 		let spy1 = sinon.spy();
-		let spy2 = sinon.spy( function( event ) {
+		let spy2 = sinon.spy( ( event ) => {
 			event.off();
 		} );
 		let spy3 = sinon.spy();
@@ -160,8 +160,8 @@ describe( 'on', function() {
 		sinon.assert.calledTwice( spy3 );
 	} );
 
-	it( 'should take the callback off() even after stop()', function() {
-		let spy1 = sinon.spy( function( event ) {
+	it( 'should take the callback off() even after stop()', () => {
+		let spy1 = sinon.spy( ( event ) => {
 			event.stop();
 			event.off();
 		} );
@@ -178,8 +178,8 @@ describe( 'on', function() {
 	} );
 } );
 
-describe( 'once', function() {
-	it( 'should be called just once', function() {
+describe( 'once', () => {
+	it( 'should be called just once', () => {
 		let spy1 = sinon.spy();
 		let spy2 = sinon.spy();
 		let spy3 = sinon.spy();
@@ -196,7 +196,7 @@ describe( 'once', function() {
 		sinon.assert.calledTwice( spy3 );
 	} );
 
-	it( 'should have proper scope', function() {
+	it( 'should have proper scope', () => {
 		let ctx = {};
 
 		let spy1 = sinon.spy();
@@ -211,7 +211,7 @@ describe( 'once', function() {
 		sinon.assert.calledOn( spy2, emitter );
 	} );
 
-	it( 'should have proper arguments', function() {
+	it( 'should have proper arguments', () => {
 		const EventInfo = modules.eventinfo;
 
 		let spy = sinon.spy();
@@ -224,8 +224,8 @@ describe( 'once', function() {
 	} );
 } );
 
-describe( 'off', function() {
-	it( 'should get callbacks off()', function() {
+describe( 'off', () => {
+	it( 'should get callbacks off()', () => {
 		let spy1 = sinon.spy();
 		let spy2 = sinon.spy();
 		let spy3 = sinon.spy();
@@ -246,11 +246,11 @@ describe( 'off', function() {
 		sinon.assert.calledThrice( spy3 );
 	} );
 
-	it( 'should not fail with unknown events', function() {
-		emitter.off( 'test', function() {} );
+	it( 'should not fail with unknown events', () => {
+		emitter.off( 'test', () => {} );
 	} );
 
-	it( 'should remove all entries for the same callback', function() {
+	it( 'should remove all entries for the same callback', () => {
 		let spy1 = sinon.spy().named( 1 );
 		let spy2 = sinon.spy().named( 2 );
 
@@ -269,7 +269,7 @@ describe( 'off', function() {
 		sinon.assert.callCount( spy2, 4 );
 	} );
 
-	it( 'should remove the callback for a specific context only', function() {
+	it( 'should remove the callback for a specific context only', () => {
 		let spy = sinon.spy().named( 1 );
 
 		let ctx1 = { ctx: 1 };
@@ -291,10 +291,10 @@ describe( 'off', function() {
 	} );
 } );
 
-describe( 'listenTo', function() {
+describe( 'listenTo', () => {
 	beforeEach( refreshListener );
 
-	it( 'should properly register callbacks', function() {
+	it( 'should properly register callbacks', () => {
 		let spy = sinon.spy();
 
 		listener.listenTo( emitter, 'test', spy );
@@ -305,10 +305,10 @@ describe( 'listenTo', function() {
 	} );
 } );
 
-describe( 'stopListening', function() {
+describe( 'stopListening', () => {
 	beforeEach( refreshListener );
 
-	it( 'should stop listening to a specific event callback', function() {
+	it( 'should stop listening to a specific event callback', () => {
 		let spy1 = sinon.spy();
 		let spy2 = sinon.spy();
 
@@ -327,7 +327,7 @@ describe( 'stopListening', function() {
 		sinon.assert.calledTwice( spy2 );
 	} );
 
-	it( 'should stop listening to an specific event', function() {
+	it( 'should stop listening to an specific event', () => {
 		let spy1a = sinon.spy();
 		let spy1b = sinon.spy();
 		let spy2 = sinon.spy();
@@ -349,7 +349,7 @@ describe( 'stopListening', function() {
 		sinon.assert.calledTwice( spy2 );
 	} );
 
-	it( 'should stop listening to all events from a specific emitter', function() {
+	it( 'should stop listening to all events from a specific emitter', () => {
 		let spy1 = sinon.spy();
 		let spy2 = sinon.spy();
 
@@ -368,7 +368,7 @@ describe( 'stopListening', function() {
 		sinon.assert.calledOnce( spy2 );
 	} );
 
-	it( 'should stop listening to everything', function() {
+	it( 'should stop listening to everything', () => {
 		let spy1 = sinon.spy();
 		let spy2 = sinon.spy();
 
@@ -394,7 +394,7 @@ describe( 'stopListening', function() {
 		expect( listener ).to.not.have.property( '_listeningTo' );
 	} );
 
-	it( 'should not stop other emitters when a non-listened emitter is provided', function() {
+	it( 'should not stop other emitters when a non-listened emitter is provided', () => {
 		let spy = sinon.spy();
 
 		let emitter1 = getEmitterInstance();

+ 4 - 4
packages/ckeditor5-utils/tests/eventinfo/eventinfo.js

@@ -7,8 +7,8 @@
 
 const modules = bender.amd.require( 'eventinfo' );
 
-describe( 'EventInfo', function() {
-	it( 'should be created properly', function() {
+describe( 'EventInfo', () => {
+	it( 'should be created properly', () => {
 		const EventInfo = modules.eventinfo;
 
 		let event = new EventInfo( this, 'test' );
@@ -19,7 +19,7 @@ describe( 'EventInfo', function() {
 		expect( event.off.called ).to.not.be.true();
 	} );
 
-	it( 'should have stop() and off() marked', function() {
+	it( 'should have stop() and off() marked', () => {
 		const EventInfo = modules.eventinfo;
 
 		let event = new EventInfo( this, 'test' );
@@ -31,7 +31,7 @@ describe( 'EventInfo', function() {
 		expect( event.off.called ).to.be.true();
 	} );
 
-	it( 'should not mark "called" in future instances', function() {
+	it( 'should not mark "called" in future instances', () => {
 		const EventInfo = modules.eventinfo;
 
 		let event = new EventInfo( this, 'test' );

+ 5 - 5
packages/ckeditor5-utils/tests/log/log.js

@@ -10,14 +10,14 @@
 const modules = bender.amd.require( 'log' );
 let spy;
 
-beforeEach( function() {
+beforeEach( () => {
 	if ( spy ) {
 		spy.restore();
 	}
 } );
 
-describe( 'warn()', function() {
-	it( 'logs the message to the console using console.warn()', function() {
+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 };
@@ -33,8 +33,8 @@ describe( 'warn()', function() {
 	} );
 } );
 
-describe( 'error()', function() {
-	it( 'logs the message to the console using console.error()', function() {
+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 };

+ 15 - 15
packages/ckeditor5-utils/tests/mvc/model/model.js

@@ -9,8 +9,8 @@ const modules = bender.amd.require( 'model', 'eventinfo', 'ckeditorerror' );
 
 let Car, car;
 
-describe( 'Model', function() {
-	beforeEach( 'Create a test model instance', function() {
+describe( 'Model', () => {
+	beforeEach( 'Create a test model instance', () => {
 		const Model = modules.model;
 
 		Car = class extends Model {};
@@ -23,27 +23,27 @@ describe( 'Model', function() {
 
 	//////////
 
-	it( 'should set _attributes on creation', function() {
+	it( 'should set _attributes on creation', () => {
 		expect( car._attributes ).to.deep.equal( {
 			color: 'red',
 			year: 2015
 		} );
 	} );
 
-	it( 'should get correctly after set', function() {
+	it( 'should get correctly after set', () => {
 		car.color = 'blue';
 
 		expect( car.color ).to.equal( 'blue' );
 		expect( car._attributes.color ).to.equal( 'blue' );
 	} );
 
-	it( 'should get correctly after setting _attributes', function() {
+	it( 'should get correctly after setting _attributes', () => {
 		car._attributes.color = 'blue';
 
 		expect( car.color ).to.equal( 'blue' );
 	} );
 
-	it( 'should add properties on creation', function() {
+	it( 'should add properties on creation', () => {
 		let car = new Car( null, {
 			prop: 1
 		} );
@@ -53,8 +53,8 @@ describe( 'Model', function() {
 
 	//////////
 
-	describe( 'set', function() {
-		it( 'should work when passing an object', function() {
+	describe( 'set', () => {
+		it( 'should work when passing an object', () => {
 			car.set( {
 				color: 'blue',	// Override
 				wheels: 4,
@@ -69,7 +69,7 @@ describe( 'Model', function() {
 			} );
 		} );
 
-		it( 'should work when passing a key/value pair', function() {
+		it( 'should work when passing a key/value pair', () => {
 			car.set( 'color', 'blue' );
 			car.set( 'wheels', 4 );
 
@@ -80,7 +80,7 @@ describe( 'Model', function() {
 			} );
 		} );
 
-		it( 'should fire the "change" event', function() {
+		it( 'should fire the "change" event', () => {
 			const EventInfo = modules.eventinfo;
 
 			let spy = sinon.spy();
@@ -119,7 +119,7 @@ describe( 'Model', function() {
 			sinon.assert.calledWithExactly( spyWheels, sinon.match.instanceOf( EventInfo ), 4, sinon.match.typeOf( 'undefined' ) );
 		} );
 
-		it( 'should not fire the "change" event for the same attribute value', function() {
+		it( 'should not fire the "change" event for the same attribute value', () => {
 			let spy = sinon.spy();
 			let spyColor = sinon.spy();
 
@@ -135,7 +135,7 @@ describe( 'Model', function() {
 			sinon.assert.notCalled( spyColor );
 		} );
 
-		it( 'should throw when overriding already existing property', function() {
+		it( 'should throw when overriding already existing property', () => {
 			const CKEditorError = modules.ckeditorerror;
 
 			car.normalProperty = 1;
@@ -147,7 +147,7 @@ describe( 'Model', function() {
 			expect( car ).to.have.property( 'normalProperty', 1 );
 		} );
 
-		it( 'should throw when overriding already existing property (in the prototype)', function() {
+		it( 'should throw when overriding already existing property (in the prototype)', () => {
 			const CKEditorError = modules.ckeditorerror;
 			const Model = modules.model;
 
@@ -165,8 +165,8 @@ describe( 'Model', function() {
 		} );
 	} );
 
-	describe( 'extend', function() {
-		it( 'should create new Model based classes', function() {
+	describe( 'extend', () => {
+		it( 'should create new Model based classes', () => {
 			const Model = modules.model;
 
 			class Truck extends Car {}

+ 3 - 3
packages/ckeditor5-utils/tests/plugin/plugin.js

@@ -8,14 +8,14 @@
 const modules = bender.amd.require( 'plugin', 'editor' );
 let editor;
 
-before( function() {
+before( () => {
 	const Editor = modules.editor;
 
 	editor = new Editor( document.body.appendChild( document.createElement( 'div' ) ) );
 } );
 
-describe( 'constructor', function() {
-	it( 'should set the `editor` property', function() {
+describe( 'constructor', () => {
+	it( 'should set the `editor` property', () => {
 		const Plugin = modules.plugin;
 
 		let plugin = new Plugin( editor );

+ 23 - 23
packages/ckeditor5-utils/tests/utils/utils.js

@@ -7,17 +7,17 @@
 
 const modules = bender.amd.require( 'utils', 'utils-lodash' );
 
-describe( 'utils', function() {
+describe( 'utils', () => {
 	let utils;
 
-	before( function() {
+	before( () => {
 		utils = modules.utils;
 	} );
 
-	describe( 'extend()', function() {
+	describe( 'extend()', () => {
 		// Properties of the subsequent objects should override properties of the preceding objects. This is critical for
 		// CKEditor so we keep this test to ensure that Lo-Dash (or whatever) implements it in the way we need it.
-		it( 'should extend by several params in the correct order', function() {
+		it( 'should extend by several params in the correct order', () => {
 			let target = {
 				a: 0,
 				b: 0
@@ -42,14 +42,14 @@ describe( 'utils', function() {
 		} );
 	} );
 
-	describe( 'spy', function() {
-		it( 'should not have `called` after creation', function() {
+	describe( 'spy', () => {
+		it( 'should not have `called` after creation', () => {
 			let spy = utils.spy();
 
 			expect( spy.called ).to.not.be.true();
 		} );
 
-		it( 'should register calls', function() {
+		it( 'should register calls', () => {
 			let fn1 = utils.spy();
 			let fn2 = utils.spy();
 
@@ -60,8 +60,8 @@ describe( 'utils', function() {
 		} );
 	} );
 
-	describe( 'uid', function() {
-		it( 'should return different ids', function() {
+	describe( 'uid', () => {
+		it( 'should return different ids', () => {
 			let id1 = utils.uid();
 			let id2 = utils.uid();
 			let id3 = utils.uid();
@@ -72,20 +72,20 @@ describe( 'utils', function() {
 		} );
 	} );
 
-	describe( 'isIterable', function() {
-		it( 'should be true for string', function() {
+	describe( 'isIterable', () => {
+		it( 'should be true for string', () => {
 			let string = 'foo';
 
 			expect( utils.isIterable( string ) ).to.be.true;
 		} );
 
-		it( 'should be true for arrays', function() {
+		it( 'should be true for arrays', () => {
 			let array = [ 1, 2, 3 ];
 
 			expect( utils.isIterable( array ) ).to.be.true;
 		} );
 
-		it( 'should be true for iterable classes', function() {
+		it( 'should be true for iterable classes', () => {
 			class IterableClass {
 				constructor() {
 					this.array = [ 1, 2, 3 ];
@@ -101,19 +101,19 @@ describe( 'utils', function() {
 			expect( utils.isIterable( instance ) ).to.be.true;
 		} );
 
-		it( 'should be false for not iterable objects', function() {
+		it( 'should be false for not iterable objects', () => {
 			let notIterable = { foo: 'bar' };
 
 			expect( utils.isIterable( notIterable ) ).to.be.false;
 		} );
 
-		it( 'should be false for undefined', function() {
+		it( 'should be false for undefined', () => {
 			expect( utils.isIterable() ).to.be.false;
 		} );
 	} );
 
-	describe( 'compareArrays', function() {
-		it( 'should return SAME flag, when arrays are same', function() {
+	describe( 'compareArrays', () => {
+		it( 'should return SAME flag, when arrays are same', () => {
 			let a = [ 'abc', 0, 3 ];
 			let b = [ 'abc', 0, 3 ];
 
@@ -122,7 +122,7 @@ describe( 'utils', function() {
 			expect( result ).to.equal( utils.compareArrays.SAME );
 		} );
 
-		it( 'should return PREFIX flag, when all n elements of first array are same as n first elements of the second array', function() {
+		it( 'should return PREFIX flag, when all n elements of first array are same as n first elements of the second array', () => {
 			let a = [ 'abc', 0 ];
 			let b = [ 'abc', 0, 3 ];
 
@@ -131,7 +131,7 @@ describe( 'utils', function() {
 			expect( result ).to.equal( utils.compareArrays.PREFIX );
 		} );
 
-		it( 'should return EXTENSION flag, when n first elements of first array are same as all elements of the second array', function() {
+		it( 'should return EXTENSION flag, when n first elements of first array are same as all elements of the second array', () => {
 			let a = [ 'abc', 0, 3 ];
 			let b = [ 'abc', 0 ];
 
@@ -140,7 +140,7 @@ describe( 'utils', function() {
 			expect( result ).to.equal( utils.compareArrays.EXTENSION );
 		} );
 
-		it( 'should return DIFFERENT flag, when arrays are not same', function() {
+		it( 'should return DIFFERENT flag, when arrays are not same', () => {
 			let a = [ 'abc', 0, 3 ];
 			let b = [ 'abc', 1, 3 ];
 
@@ -150,13 +150,13 @@ describe( 'utils', function() {
 		} );
 	} );
 
-	describe( 'Lo-Dash extensions', function() {
+	describe( 'Lo-Dash extensions', () => {
 		// Ensures that the required Lo-Dash extensions are available in `utils`.
-		it( 'should be exposed in utils', function() {
+		it( 'should be exposed in utils', () => {
 			let utils = modules.utils;
 			let extensions = modules[ 'utils-lodash' ];
 
-			extensions.forEach( function( extension ) {
+			extensions.forEach( ( extension ) => {
 				expect( utils ).to.have.property( extension ).to.not.be.undefined();
 			} );
 		} );