ソースを参照

Fixed remaining references to utils.

Piotrek Koszuliński 9 年 前
コミット
e5fb24d91c

+ 1 - 1
packages/ckeditor5-engine/src/treemodel/operation/operation.js

@@ -5,7 +5,7 @@
 
 'use strict';
 
-import clone from '../../lib/lodash/clone.js';
+import clone from '../../../utils/lib/lodash/clone.js';
 
 /**
  * Abstract base operation class.

+ 1 - 1
packages/ckeditor5-engine/tests/creator/manual/creator-classic.js

@@ -9,7 +9,7 @@
 
 import CKEDITOR from '/ckeditor.js';
 import ClassicCreator from '/tests/core/creator/manual/_utils/creator/classiccreator.js';
-import testUtils from '/tests/core/_utils/utils.js';
+import testUtils from '/tests/utils/_utils/utils.js';
 
 let editor, observer;
 

+ 1 - 1
packages/ckeditor5-engine/tests/creator/manual/creator-inline.js

@@ -9,7 +9,7 @@
 
 import CKEDITOR from '/ckeditor.js';
 import InlineCreator from '/tests/core/creator/manual/_utils/creator/inlinecreator.js';
-import testUtils from '/tests/core/_utils/utils.js';
+import testUtils from '/tests/utils/_utils/utils.js';
 
 let editor, observer;
 

+ 3 - 3
packages/ckeditor5-engine/tests/editable/editable.js

@@ -10,7 +10,7 @@
 import Editor from '/ckeditor5/core/editor.js';
 import Editable from '/ckeditor5/core/editable/editable.js';
 import Model from '/ckeditor5/core/ui/model.js';
-import coreTestUtils from '/tests/core/_utils/utils.js';
+import testUtils from '/tests/utils/_utils/utils.js';
 
 describe( 'Editable', () => {
 	let editable, editor;
@@ -43,7 +43,7 @@ describe( 'Editable', () => {
 		} );
 
 		it( 'binds this.isFocused to editable', () => {
-			coreTestUtils.assertBinding(
+			testUtils.assertBinding(
 				editable,
 				{ isFocused: false },
 				[
@@ -54,7 +54,7 @@ describe( 'Editable', () => {
 		} );
 
 		it( 'binds editable.isEditable to itself', () => {
-			coreTestUtils.assertBinding(
+			testUtils.assertBinding(
 				editable.viewModel,
 				{ isEditable: true },
 				[

+ 1 - 1
packages/ckeditor5-engine/tests/treemodel/batch.js

@@ -7,8 +7,8 @@
 
 'use strict';
 
+/* jshint unused: false */
 import deltas from '/ckeditor5/core/treemodel/delta/basic-deltas.js';
-/*jshint unused: false*/
 
 import Batch from '/ckeditor5/core/treemodel/batch.js';
 import { register } from '/ckeditor5/core/treemodel/batch.js';

+ 2 - 2
packages/ckeditor5-engine/tests/treemodel/delta/attributedelta.js

@@ -7,7 +7,7 @@
 
 'use strict';
 
-import coreTestUtils from '/tests/core/_utils/utils.js';
+import testUtils from '/tests/utils/_utils/utils.js';
 import Document from '/ckeditor5/core/treemodel/document.js';
 import Text from '/ckeditor5/core/treemodel/text.js';
 import Range from '/ckeditor5/core/treemodel/range.js';
@@ -17,7 +17,7 @@ import Element from '/ckeditor5/core/treemodel/element.js';
 import AttributeDelta from '/ckeditor5/core/treemodel/delta/attributedelta.js';
 import AttributeOperation from '/ckeditor5/core/treemodel/operation/attributeoperation.js';
 
-const getIteratorCount = coreTestUtils.getIteratorCount;
+const getIteratorCount = testUtils.getIteratorCount;
 
 let doc, root;
 

+ 2 - 2
packages/ckeditor5-engine/tests/treemodel/delta/delta.js

@@ -7,7 +7,7 @@
 
 'use strict';
 
-import coreTestUtils from '/tests/core/_utils/utils.js';
+import testUtils from '/tests/utils/_utils/utils.js';
 import Delta from '/ckeditor5/core/treemodel/delta/delta.js';
 import Operation from '/ckeditor5/core/treemodel/operation/operation.js';
 
@@ -31,7 +31,7 @@ class BarOperation extends FooOperation {
 	}
 }
 
-const getIteratorCount = coreTestUtils.getIteratorCount;
+const getIteratorCount = testUtils.getIteratorCount;
 
 describe( 'Delta', () => {
 	describe( 'constructor', () => {

+ 2 - 2
packages/ckeditor5-engine/tests/treeview/converter.js

@@ -7,12 +7,12 @@
 
 'use strict';
 
-import coreTestUtils from '/tests/core/_utils/utils.js';
+import testUtils from '/tests/utils/_utils/utils.js';
 import ViewElement from '/ckeditor5/core/treeview/element.js';
 import ViewText from '/ckeditor5/core/treeview/text.js';
 import Converter from '/ckeditor5/core/treeview/converter.js';
 
-const getIteratorCount = coreTestUtils.getIteratorCount;
+const getIteratorCount = testUtils.getIteratorCount;
 
 describe( 'converter', () => {
 	let converter;

+ 2 - 2
packages/ckeditor5-engine/tests/treeview/element.js

@@ -7,11 +7,11 @@
 
 'use strict';
 
-import coreTestUtils from '/tests/core/_utils/utils.js';
+import testUtils from '/tests/utils/_utils/utils.js';
 import Node from '/ckeditor5/core/treeview/node.js';
 import ViewElement from '/ckeditor5/core/treeview/element.js';
 
-const getIteratorCount = coreTestUtils.getIteratorCount;
+const getIteratorCount = testUtils.getIteratorCount;
 
 describe( 'Element', () => {
 	describe( 'constructor', () => {

+ 0 - 60
packages/ckeditor5-engine/tests/utils-tests/utils.js

@@ -8,9 +8,7 @@
 import testUtils from '/tests/_utils/utils.js';
 import moduleTestUtils from '/tests/_utils/module.js';
 import coreTestUtils from '/tests/core/_utils/utils.js';
-import Model from '/ckeditor5/core/ui/model.js';
 import Creator from '/ckeditor5/core/creator.js';
-import EmitterMixin from '/ckeditor5/utils/emittermixin.js';
 
 let createFn3 = () => {};
 let destroyFn3 = () => {};
@@ -58,61 +56,3 @@ describe( 'coreTestUtils.defineEditorCreatorMock()', () => {
 		expect( TestCreator3.prototype ).to.have.property( 'destroy', destroyFn3 );
 	} );
 } );
-
-describe( 'coreTestUtils.getIteratorCount()', () => {
-	it( 'should returns number of editable items', () => {
-		const count = coreTestUtils.getIteratorCount( [ 1, 2, 3, 4, 5 ] );
-		expect( count ).to.equal( 5 );
-	} );
-} );
-
-describe( 'coreTestUtils.createObserver()', () => {
-	let observable, observable2, observer;
-
-	beforeEach( () => {
-		observer = coreTestUtils.createObserver();
-		observable = new Model( { foo: 0, bar: 0 } );
-		observable2 = new Model( { foo: 0, bar: 0 } );
-	} );
-
-	it( 'should create an observer', () => {
-		function Emitter() {}
-		Emitter.prototype = EmitterMixin;
-
-		expect( observer  ).to.be.instanceof( Emitter );
-		expect( observer.observe ).is.a( 'function' );
-		expect( observer.stopListening ).is.a( 'function' );
-	} );
-
-	describe( 'Observer', () => {
-		/* global console:false  */
-
-		it( 'logs changes in the observable', () => {
-			const spy = testUtils.sinon.stub( console, 'log' );
-
-			observer.observe( 'Some observable', observable );
-			observer.observe( 'Some observable 2', observable2 );
-
-			observable.foo = 1;
-			expect( spy.callCount ).to.equal( 1 );
-
-			observable.foo = 2;
-			observable2.bar = 3;
-			expect( spy.callCount ).to.equal( 3 );
-		} );
-
-		it( 'stops listening when asked to do so', () => {
-			const spy = testUtils.sinon.stub( console, 'log' );
-
-			observer.observe( 'Some observable', observable );
-
-			observable.foo = 1;
-			expect( spy.callCount ).to.equal( 1 );
-
-			observer.stopListening();
-
-			observable.foo = 2;
-			expect( spy.callCount ).to.equal( 1 );
-		} );
-	} );
-} );