Przeglądaj źródła

Revert "Merge pull request #573 from ckeditor/t/572"

This reverts commit 563ebacadb2d20743e253a14d41f602b465da6c2, reversing
changes made to 594a84c5b421de8df74234e6865c1099f769e682.
Maksymilian Barnaś 9 lat temu
rodzic
commit
a04d16dc61
36 zmienionych plików z 139 dodań i 99 usunięć
  1. 2 1
      packages/ckeditor5-engine/tests/model/batch.js
  2. 3 1
      packages/ckeditor5-engine/tests/model/delta/deltafactory.js
  3. 3 2
      packages/ckeditor5-engine/tests/model/delta/mergedelta.js
  4. 2 1
      packages/ckeditor5-engine/tests/model/delta/movedelta.js
  5. 2 1
      packages/ckeditor5-engine/tests/model/delta/renamedelta.js
  6. 2 1
      packages/ckeditor5-engine/tests/model/delta/splitdelta.js
  7. 2 1
      packages/ckeditor5-engine/tests/model/delta/unwrapdelta.js
  8. 4 3
      packages/ckeditor5-engine/tests/model/delta/wrapdelta.js
  9. 12 11
      packages/ckeditor5-engine/tests/model/document/document.js
  10. 3 2
      packages/ckeditor5-engine/tests/model/documentfragment.js
  11. 3 2
      packages/ckeditor5-engine/tests/model/element.js
  12. 3 1
      packages/ckeditor5-engine/tests/model/history.js
  13. 2 1
      packages/ckeditor5-engine/tests/model/liveposition.js
  14. 3 2
      packages/ckeditor5-engine/tests/model/node.js
  15. 6 5
      packages/ckeditor5-engine/tests/model/nodelist.js
  16. 3 2
      packages/ckeditor5-engine/tests/model/operation/attributeoperation.js
  17. 5 4
      packages/ckeditor5-engine/tests/model/operation/moveoperation.js
  18. 4 3
      packages/ckeditor5-engine/tests/model/operation/rootattributeoperation.js
  19. 9 8
      packages/ckeditor5-engine/tests/model/position.js
  20. 4 3
      packages/ckeditor5-engine/tests/model/schema/schema.js
  21. 5 4
      packages/ckeditor5-engine/tests/model/selection.js
  22. 5 4
      packages/ckeditor5-engine/tests/model/textproxy.js
  23. 5 4
      packages/ckeditor5-engine/tests/model/treewalker.js
  24. 4 2
      packages/ckeditor5-engine/tests/model/writer.js
  25. 2 1
      packages/ckeditor5-engine/tests/view/node.js
  26. 4 2
      packages/ckeditor5-engine/tests/view/position.js
  27. 2 1
      packages/ckeditor5-engine/tests/view/renderer.js
  28. 5 4
      packages/ckeditor5-engine/tests/view/selection.js
  29. 5 4
      packages/ckeditor5-engine/tests/view/textproxy.js
  30. 5 4
      packages/ckeditor5-engine/tests/view/treewalker.js
  31. 3 2
      packages/ckeditor5-engine/tests/view/writer/breakrange.js
  32. 4 3
      packages/ckeditor5-engine/tests/view/writer/insert.js
  33. 3 2
      packages/ckeditor5-engine/tests/view/writer/remove.js
  34. 4 3
      packages/ckeditor5-engine/tests/view/writer/unwrap.js
  35. 4 3
      packages/ckeditor5-engine/tests/view/writer/wrap.js
  36. 2 1
      packages/ckeditor5-engine/tests/view/writer/wrapposition.js

+ 2 - 1
packages/ckeditor5-engine/tests/model/batch.js

@@ -12,6 +12,7 @@ import Batch from '/ckeditor5/engine/model/batch.js';
 import { register } from '/ckeditor5/engine/model/batch.js';
 import Delta from '/ckeditor5/engine/model/delta/delta.js';
 import Operation from '/ckeditor5/engine/model/operation/operation.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'Batch', () => {
 	it( 'should have registered basic methods', () => {
@@ -57,7 +58,7 @@ describe( 'Batch', () => {
 
 			expect( () => {
 				register( 'foo', () => {} );
-			} ).to.throwCKEditorError( /^model-batch-register-taken/ );
+			} ).to.throw( CKEditorError, /^model-batch-register-taken/ );
 		} );
 	} );
 

+ 3 - 1
packages/ckeditor5-engine/tests/model/delta/deltafactory.js

@@ -16,6 +16,8 @@ import ReinsertOperation from '/ckeditor5/engine/model/operation/reinsertoperati
 import RemoveOperation from '/ckeditor5/engine/model/operation/removeoperation.js';
 import RootAttributeOperation from '/ckeditor5/engine/model/operation/rootattributeoperation.js';
 
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
+
 import DeltaFactory from '/ckeditor5/engine/model/delta/deltafactory.js';
 
 import Document from '/ckeditor5/engine/model/document.js';
@@ -53,7 +55,7 @@ describe( 'DeltaFactory', () => {
 		it( 'should throw error for unregistered delta', () => {
 			expect( () => {
 				DeltaFactory.fromJSON( jsonParseStringify( new BarDelta() ), {} );
-			} ).to.throwCKEditorError( /^delta-fromjson-no-deserializer/ );
+			} ).to.throw( CKEditorError, /^delta-fromjson-no-deserializer/ );
 		} );
 
 		it( 'should create delta with AttributeOperation', () => {

+ 3 - 2
packages/ckeditor5-engine/tests/model/delta/mergedelta.js

@@ -9,6 +9,7 @@ import Document from '/ckeditor5/engine/model/document.js';
 import Position from '/ckeditor5/engine/model/position.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 import MergeDelta from '/ckeditor5/engine/model/delta/mergedelta.js';
 import SplitDelta from '/ckeditor5/engine/model/delta/splitdelta.js';
@@ -47,13 +48,13 @@ describe( 'Batch', () => {
 		it( 'should throw if there is no element after', () => {
 			expect( () => {
 				doc.batch().merge( new Position( root, [ 2 ] ) );
-			} ).to.throwCKEditorError( /^batch-merge-no-element-after/ );
+			} ).to.throw( CKEditorError, /^batch-merge-no-element-after/ );
 		} );
 
 		it( 'should throw if there is no element before', () => {
 			expect( () => {
 				doc.batch().merge( new Position( root, [ 0, 2 ] ) );
-			} ).to.throwCKEditorError( /^batch-merge-no-element-before/ );
+			} ).to.throw( CKEditorError, /^batch-merge-no-element-before/ );
 		} );
 
 		it( 'should be chainable', () => {

+ 2 - 1
packages/ckeditor5-engine/tests/model/delta/movedelta.js

@@ -11,6 +11,7 @@ import Position from '/ckeditor5/engine/model/position.js';
 import Range from '/ckeditor5/engine/model/range.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 import MoveDelta from '/ckeditor5/engine/model/delta/movedelta.js';
 import MoveOperation from '/ckeditor5/engine/model/operation/moveoperation.js';
@@ -55,7 +56,7 @@ describe( 'Batch', () => {
 
 			expect( () => {
 				doc.batch().move( notFlatRange, new Position( root, [ 1, 3 ] ) );
-			} ).to.throwCKEditorError( /^batch-move-range-not-flat/ );
+			} ).to.throw( CKEditorError, /^batch-move-range-not-flat/ );
 		} );
 
 		it( 'should be chainable', () => {

+ 2 - 1
packages/ckeditor5-engine/tests/model/delta/renamedelta.js

@@ -8,6 +8,7 @@
 import Document from '/ckeditor5/engine/model/document.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 import RenameDelta from '/ckeditor5/engine/model/delta/renamedelta.js';
 
@@ -36,7 +37,7 @@ describe( 'Batch', () => {
 		it( 'should throw if not an Element instance is passed', () => {
 			expect( () => {
 				batch.rename( 'h', new Text( 'abc' ) );
-			} ).to.throwCKEditorError( /^batch-rename-not-element-instance/ );
+			} ).to.throw( CKEditorError, /^batch-rename-not-element-instance/ );
 		} );
 
 		it( 'should be chainable', () => {

+ 2 - 1
packages/ckeditor5-engine/tests/model/delta/splitdelta.js

@@ -9,6 +9,7 @@ import Document from '/ckeditor5/engine/model/document.js';
 import Position from '/ckeditor5/engine/model/position.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 import MergeDelta from '/ckeditor5/engine/model/delta/mergedelta.js';
 import SplitDelta from '/ckeditor5/engine/model/delta/splitdelta.js';
@@ -70,7 +71,7 @@ describe( 'Batch', () => {
 		it( 'should throw if we try to split a root', () => {
 			expect( () => {
 				doc.batch().split( new Position( root, [ 0 ] ) );
-			} ).to.throwCKEditorError( /^batch-split-root/ );
+			} ).to.throw( CKEditorError, /^batch-split-root/ );
 		} );
 
 		it( 'should be chainable', () => {

+ 2 - 1
packages/ckeditor5-engine/tests/model/delta/unwrapdelta.js

@@ -9,6 +9,7 @@ import Document from '/ckeditor5/engine/model/document.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
 import Position from '/ckeditor5/engine/model/position.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 import UnwrapDelta from '/ckeditor5/engine/model/delta/unwrapdelta.js';
 import WrapDelta from '/ckeditor5/engine/model/delta/wrapdelta.js';
@@ -41,7 +42,7 @@ describe( 'Batch', () => {
 
 			expect( () => {
 				doc.batch().unwrap( element );
-			} ).to.throwCKEditorError( /^batch-unwrap-element-no-parent/ );
+			} ).to.throw( CKEditorError, /^batch-unwrap-element-no-parent/ );
 		} );
 
 		it( 'should be chainable', () => {

+ 4 - 3
packages/ckeditor5-engine/tests/model/delta/wrapdelta.js

@@ -10,6 +10,7 @@ import Position from '/ckeditor5/engine/model/position.js';
 import Range from '/ckeditor5/engine/model/range.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 import WrapDelta from '/ckeditor5/engine/model/delta/wrapdelta.js';
 import UnwrapDelta from '/ckeditor5/engine/model/delta/unwrapdelta.js';
@@ -58,7 +59,7 @@ describe( 'Batch', () => {
 
 			expect( () => {
 				doc.batch().wrap( notFlatRange, 'p' );
-			} ).to.throwCKEditorError( /^batch-wrap-range-not-flat/ );
+			} ).to.throw( CKEditorError, /^batch-wrap-range-not-flat/ );
 		} );
 
 		it( 'should throw if element to wrap with has children', () => {
@@ -66,7 +67,7 @@ describe( 'Batch', () => {
 
 			expect( () => {
 				doc.batch().wrap( range, p );
-			} ).to.throwCKEditorError( /^batch-wrap-element-not-empty/ );
+			} ).to.throw( CKEditorError, /^batch-wrap-element-not-empty/ );
 		} );
 
 		it( 'should throw if element to wrap with has children', () => {
@@ -75,7 +76,7 @@ describe( 'Batch', () => {
 
 			expect( () => {
 				doc.batch().wrap( range, p );
-			} ).to.throwCKEditorError( /^batch-wrap-element-attached/ );
+			} ).to.throw( CKEditorError, /^batch-wrap-element-attached/ );
 		} );
 
 		it( 'should be chainable', () => {

+ 12 - 11
packages/ckeditor5-engine/tests/model/document/document.js

@@ -12,6 +12,7 @@ import RootElement from '/ckeditor5/engine/model/rootelement.js';
 import Batch from '/ckeditor5/engine/model/batch.js';
 import Delta from '/ckeditor5/engine/model/delta/delta.js';
 import Range from '/ckeditor5/engine/model/range.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import count from '/ckeditor5/utils/count.js';
 import { jsonParseStringify } from '/tests/engine/model/_utils/utils.js';
 
@@ -76,7 +77,7 @@ describe( 'Document', () => {
 				() => {
 					doc.createRoot( '$root', 'rootName' );
 				}
-			).to.throwCKEditorError( /model-document-createRoot-name-exists/ );
+			).to.throw( CKEditorError, /model-document-createRoot-name-exists/ );
 		} );
 	} );
 
@@ -93,7 +94,7 @@ describe( 'Document', () => {
 				() => {
 					doc.getRoot( 'root' );
 				}
-			).to.throwCKEditorError( /model-document-getRoot-root-not-exist/ );
+			).to.throw( CKEditorError, /model-document-getRoot-root-not-exist/ );
 		} );
 	} );
 
@@ -147,7 +148,7 @@ describe( 'Document', () => {
 				() => {
 					doc.applyOperation( operation );
 				}
-			).to.throwCKEditorError( /model-document-applyOperation-wrong-version/ );
+			).to.throw( CKEditorError, /model-document-applyOperation-wrong-version/ );
 		} );
 	} );
 
@@ -246,11 +247,11 @@ describe( 'Document', () => {
 
 			expect( () => {
 				doc.selection.setRanges( [ Range.createFromParentsAndOffsets( root, 0, root, 1 ) ] );
-			} ).to.throwCKEditorError( /document-selection-wrong-position/ );
+			} ).to.throw( CKEditorError, /document-selection-wrong-position/ );
 
 			expect( () => {
 				doc.selection.setRanges( [ Range.createFromParentsAndOffsets( root, 1, root, 2 ) ] );
-			} ).to.throwCKEditorError( /document-selection-wrong-position/ );
+			} ).to.throw( CKEditorError, /document-selection-wrong-position/ );
 		} );
 
 		it( 'should throw if one of ranges starts or ends between base character and combining mark', () => {
@@ -259,27 +260,27 @@ describe( 'Document', () => {
 
 			expect( () => {
 				doc.selection.setRanges( [ Range.createFromParentsAndOffsets( root, 3, root, 9 ) ] );
-			} ).to.throwCKEditorError( /document-selection-wrong-position/ );
+			} ).to.throw( CKEditorError, /document-selection-wrong-position/ );
 
 			expect( () => {
 				doc.selection.setRanges( [ Range.createFromParentsAndOffsets( root, 4, root, 9 ) ] );
-			} ).to.throwCKEditorError( /document-selection-wrong-position/ );
+			} ).to.throw( CKEditorError, /document-selection-wrong-position/ );
 
 			expect( () => {
 				doc.selection.setRanges( [ Range.createFromParentsAndOffsets( root, 5, root, 9 ) ] );
-			} ).to.throwCKEditorError( /document-selection-wrong-position/ );
+			} ).to.throw( CKEditorError, /document-selection-wrong-position/ );
 
 			expect( () => {
 				doc.selection.setRanges( [ Range.createFromParentsAndOffsets( root, 1, root, 3 ) ] );
-			} ).to.throwCKEditorError( /document-selection-wrong-position/ );
+			} ).to.throw( CKEditorError, /document-selection-wrong-position/ );
 
 			expect( () => {
 				doc.selection.setRanges( [ Range.createFromParentsAndOffsets( root, 1, root, 4 ) ] );
-			} ).to.throwCKEditorError( /document-selection-wrong-position/ );
+			} ).to.throw( CKEditorError, /document-selection-wrong-position/ );
 
 			expect( () => {
 				doc.selection.setRanges( [ Range.createFromParentsAndOffsets( root, 1, root, 5 ) ] );
-			} ).to.throwCKEditorError( /document-selection-wrong-position/ );
+			} ).to.throw( CKEditorError, /document-selection-wrong-position/ );
 		} );
 	} );
 

+ 3 - 2
packages/ckeditor5-engine/tests/model/documentfragment.js

@@ -9,6 +9,7 @@ import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
 import DocumentFragment from '/ckeditor5/engine/model/documentfragment.js';
 import { jsonParseStringify } from '/tests/engine/model/_utils/utils.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'DocumentFragment', () => {
 	describe( 'constructor', () => {
@@ -88,11 +89,11 @@ describe( 'DocumentFragment', () => {
 		it( 'should throw if given offset is too high or too low', () => {
 			expect( () => {
 				frag.offsetToIndex( -1 );
-			} ).to.throwCKEditorError( /nodelist-offset-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /nodelist-offset-out-of-bounds/ );
 
 			expect( () => {
 				frag.offsetToIndex( 55 );
-			} ).to.throwCKEditorError( /nodelist-offset-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /nodelist-offset-out-of-bounds/ );
 		} );
 
 		it( 'should return length if given offset is equal to maxOffset', () => {

+ 3 - 2
packages/ckeditor5-engine/tests/model/element.js

@@ -10,6 +10,7 @@ import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
 import { jsonParseStringify } from '/tests/engine/model/_utils/utils.js';
 import count from '/ckeditor5/utils/count.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'Element', () => {
 	describe( 'constructor', () => {
@@ -210,11 +211,11 @@ describe( 'Element', () => {
 		it( 'should throw if given offset is too high or too low', () => {
 			expect( () => {
 				element.offsetToIndex( -1 );
-			} ).to.throwCKEditorError( /nodelist-offset-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /nodelist-offset-out-of-bounds/ );
 
 			expect( () => {
 				element.offsetToIndex( 55 );
-			} ).to.throwCKEditorError( /nodelist-offset-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /nodelist-offset-out-of-bounds/ );
 		} );
 
 		it( 'should return length if given offset is equal to maxOffset', () => {

+ 3 - 1
packages/ckeditor5-engine/tests/model/history.js

@@ -7,6 +7,8 @@ import History from '/ckeditor5/engine/model/history.js';
 import Delta from '/ckeditor5/engine/model/delta/delta.js';
 import Operation from '/ckeditor5/engine/model/operation/operation.js';
 
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
+
 describe( 'History', () => {
 	let history;
 
@@ -128,7 +130,7 @@ describe( 'History', () => {
 		it( 'should throw if given history point is "inside" delta', () => {
 			expect( () => {
 				Array.from( history.getDeltas( 2 ) );
-			} ).to.throwCKEditorError( /model-history-wrong-version/ );
+			} ).to.throw( CKEditorError, /model-history-wrong-version/ );
 		} );
 	} );
 

+ 2 - 1
packages/ckeditor5-engine/tests/model/liveposition.js

@@ -12,6 +12,7 @@ import Text from '/ckeditor5/engine/model/text.js';
 import Position from '/ckeditor5/engine/model/position.js';
 import LivePosition from '/ckeditor5/engine/model/liveposition.js';
 import Range from '/ckeditor5/engine/model/range.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'LivePosition', () => {
 	let doc, root, ul, p, li1, li2;
@@ -38,7 +39,7 @@ describe( 'LivePosition', () => {
 	it( 'should throw if given root is not a RootElement', () => {
 		expect( () => {
 			new LivePosition( new DocumentFragment(), [ 1 ] );
-		} ).to.throwCKEditorError( /model-liveposition-root-not-rootelement/ );
+		} ).to.throw( CKEditorError, /model-liveposition-root-not-rootelement/ );
 	} );
 
 	it( 'should listen to a change event of the document that owns this position root', () => {

+ 3 - 2
packages/ckeditor5-engine/tests/model/node.js

@@ -10,6 +10,7 @@ import DocumentFragment from '/ckeditor5/engine/model/documentfragment.js';
 import Node from '/ckeditor5/engine/model/node.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import count from '/ckeditor5/utils/count.js';
 
 describe( 'Node', () => {
@@ -131,7 +132,7 @@ describe( 'Node', () => {
 				() => {
 					node.index;
 				}
-			).to.throwCKEditorError( /model-node-not-found-in-parent/ );
+			).to.throw( CKEditorError, /model-node-not-found-in-parent/ );
 		} );
 	} );
 
@@ -185,7 +186,7 @@ describe( 'Node', () => {
 				() => {
 					node.startOffset;
 				}
-			).to.throwCKEditorError( /model-node-not-found-in-parent/ );
+			).to.throw( CKEditorError, /model-node-not-found-in-parent/ );
 		} );
 	} );
 

+ 6 - 5
packages/ckeditor5-engine/tests/model/nodelist.js

@@ -9,6 +9,7 @@ import NodeList from '/ckeditor5/engine/model/nodelist.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
 import { jsonParseStringify } from '/tests/engine/model/_utils/utils.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'NodeList', () => {
 	let nodes, p, foo, img;
@@ -86,11 +87,11 @@ describe( 'NodeList', () => {
 		it( 'should throw if given offset is too high or too low', () => {
 			expect( () => {
 				nodes.indexToOffset( -1 );
-			} ).to.throwCKEditorError( /model-nodelist-index-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /model-nodelist-index-out-of-bounds/ );
 
 			expect( () => {
 				nodes.indexToOffset( 99 );
-			} ).to.throwCKEditorError( /model-nodelist-index-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /model-nodelist-index-out-of-bounds/ );
 		} );
 
 		it( 'should return length if given offset is equal to maxOffset', () => {
@@ -110,11 +111,11 @@ describe( 'NodeList', () => {
 		it( 'should throw if given offset is too high or too low', () => {
 			expect( () => {
 				nodes.offsetToIndex( -1 );
-			} ).to.throwCKEditorError( /nodelist-offset-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /nodelist-offset-out-of-bounds/ );
 
 			expect( () => {
 				nodes.offsetToIndex( 55 );
-			} ).to.throwCKEditorError( /nodelist-offset-out-of-bounds/ );
+			} ).to.throw( CKEditorError, /nodelist-offset-out-of-bounds/ );
 		} );
 
 		it( 'should return length if given offset is equal to maxOffset', () => {
@@ -161,7 +162,7 @@ describe( 'NodeList', () => {
 		it( 'should throw if not a Node is inserted', () => {
 			expect( () => {
 				nodes.insertNodes( 0, [ 'foo' ] );
-			} ).to.throwCKEditorError( /nodelist-insertNodes-not-node/ );
+			} ).to.throw( CKEditorError, /nodelist-insertNodes-not-node/ );
 		} );
 	} );
 

+ 3 - 2
packages/ckeditor5-engine/tests/model/operation/attributeoperation.js

@@ -11,6 +11,7 @@ import Text from '/ckeditor5/engine/model/text.js';
 import AttributeOperation from '/ckeditor5/engine/model/operation/attributeoperation.js';
 import Position from '/ckeditor5/engine/model/position.js';
 import Range from '/ckeditor5/engine/model/range.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import count from '/ckeditor5/utils/count.js';
 import { jsonParseStringify, wrapInDelta } from '/tests/engine/model/_utils/utils.js';
 
@@ -295,7 +296,7 @@ describe( 'AttributeOperation', () => {
 					doc.version
 				)
 			) );
-		} ).to.throwCKEditorError( /attribute-operation-wrong-old-value/ );
+		} ).to.throw( CKEditorError, /attribute-operation-wrong-old-value/ );
 	} );
 
 	it( 'should throw an error when one try to insert and the attribute already exists', () => {
@@ -311,7 +312,7 @@ describe( 'AttributeOperation', () => {
 					doc.version
 				)
 			) );
-		} ).to.throwCKEditorError( /attribute-operation-attribute-exists/ );
+		} ).to.throw( CKEditorError, /attribute-operation-attribute-exists/ );
 	} );
 
 	it( 'should create an AttributeOperation with the same parameters when cloned', () => {

+ 5 - 4
packages/ckeditor5-engine/tests/model/operation/moveoperation.js

@@ -10,6 +10,7 @@ import MoveOperation from '/ckeditor5/engine/model/operation/moveoperation.js';
 import Position from '/ckeditor5/engine/model/position.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import { jsonParseStringify, wrapInDelta } from '/tests/engine/model/_utils/utils.js';
 
 describe( 'MoveOperation', () => {
@@ -160,7 +161,7 @@ describe( 'MoveOperation', () => {
 			doc.version
 		);
 
-		expect( () => doc.applyOperation( wrapInDelta( operation ) ) ).to.throwCKEditorError( /move-operation-nodes-do-not-exist/ );
+		expect( () => doc.applyOperation( wrapInDelta( operation ) ) ).to.throw( CKEditorError, /move-operation-nodes-do-not-exist/ );
 	} );
 
 	it( 'should throw an error if target or source parent-element specified by position does not exist', () => {
@@ -177,7 +178,7 @@ describe( 'MoveOperation', () => {
 
 		root.removeChildren( 1 );
 
-		expect( () => doc.applyOperation( wrapInDelta( operation ) ) ).to.throwCKEditorError( /move-operation-position-invalid/ );
+		expect( () => doc.applyOperation( wrapInDelta( operation ) ) ).to.throw( CKEditorError, /move-operation-position-invalid/ );
 	} );
 
 	it( 'should throw an error if operation tries to move a range between the beginning and the end of that range', () => {
@@ -190,7 +191,7 @@ describe( 'MoveOperation', () => {
 			doc.version
 		);
 
-		expect( () => doc.applyOperation( wrapInDelta( operation ) ) ).to.throwCKEditorError( /move-operation-range-into-itself/ );
+		expect( () => doc.applyOperation( wrapInDelta( operation ) ) ).to.throw( CKEditorError, /move-operation-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', () => {
@@ -204,7 +205,7 @@ describe( 'MoveOperation', () => {
 			doc.version
 		);
 
-		expect( () => doc.applyOperation( wrapInDelta( operation ) ) ).to.throwCKEditorError( /move-operation-node-into-itself/ );
+		expect( () => doc.applyOperation( wrapInDelta( operation ) ) ).to.throw( CKEditorError, /move-operation-node-into-itself/ );
 	} );
 
 	it( 'should not throw an error if operation move a range into a sibling', () => {

+ 4 - 3
packages/ckeditor5-engine/tests/model/operation/rootattributeoperation.js

@@ -7,6 +7,7 @@
 
 import Document from '/ckeditor5/engine/model/document.js';
 import RootAttributeOperation from '/ckeditor5/engine/model/operation/rootattributeoperation.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import { jsonParseStringify, wrapInDelta } from '/tests/engine/model/_utils/utils.js';
 
 describe( 'RootAttributeOperation', () => {
@@ -185,7 +186,7 @@ describe( 'RootAttributeOperation', () => {
 					doc.version
 				)
 			) );
-		} ).to.throwCKEditorError( /rootattribute-operation-wrong-old-value/ );
+		} ).to.throw( CKEditorError, /rootattribute-operation-wrong-old-value/ );
 	} );
 
 	it( 'should throw an error when one try to insert and the attribute already exists', () => {
@@ -201,7 +202,7 @@ describe( 'RootAttributeOperation', () => {
 					doc.version
 				)
 			) );
-		} ).to.throwCKEditorError( /rootattribute-operation-attribute-exists/ );
+		} ).to.throw( CKEditorError, /rootattribute-operation-attribute-exists/ );
 	} );
 
 	it( 'should create a RootAttributeOperation with the same parameters when cloned', () => {
@@ -270,7 +271,7 @@ describe( 'RootAttributeOperation', () => {
 
 			expect( () => {
 				RootAttributeOperation.fromJSON( serialized, doc );
-			} ).to.throwCKEditorError( /rootattribute-operation-fromjson-no-roo/ );
+			} ).to.throw( CKEditorError, /rootattribute-operation-fromjson-no-roo/ );
 		} );
 	} );
 } );

+ 9 - 8
packages/ckeditor5-engine/tests/model/position.js

@@ -11,6 +11,7 @@ import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
 import TextProxy from '/ckeditor5/engine/model/textproxy.js';
 import Position from '/ckeditor5/engine/model/position.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import testUtils from '/tests/core/_utils/utils.js';
 import { jsonParseStringify } from '/tests/engine/model/_utils/utils.js';
 
@@ -101,21 +102,21 @@ describe( 'position', () => {
 		it( 'should throw error if given path is incorrect', () => {
 			expect( () => {
 				new Position( root, {} );
-			} ).to.throwCKEditorError( /model-position-path-incorrect/ );
+			} ).to.throw( CKEditorError, /model-position-path-incorrect/ );
 
 			expect( () => {
 				new Position( root, [] );
-			} ).to.throwCKEditorError( /model-position-path-incorrect/ );
+			} ).to.throw( CKEditorError, /model-position-path-incorrect/ );
 		} );
 
 		it( 'should throw error if given root is invalid', () => {
 			expect( () => {
 				new Position( new Text( 'a' ) );
-			} ).to.throwCKEditorError( /model-position-root-invalid/ );
+			} ).to.throw( CKEditorError, /model-position-root-invalid/ );
 
 			expect( () => {
 				new Position();
-			} ).to.throwCKEditorError( /model-position-root-invalid/ );
+			} ).to.throw( CKEditorError, /model-position-root-invalid/ );
 		} );
 	} );
 
@@ -140,7 +141,7 @@ describe( 'position', () => {
 		it( 'throws when parent is not an element', () => {
 			expect( () => {
 				Position.createFromParentAndOffset( b, 0 );
-			} ).to.throwCKEditorError( /^model-position-parent-incorrect/ );
+			} ).to.throw( CKEditorError, /^model-position-parent-incorrect/ );
 		} );
 
 		it( 'works with a doc frag', () => {
@@ -200,7 +201,7 @@ describe( 'position', () => {
 		it( 'should throw error if one try to create positions before root', () => {
 			expect( () => {
 				Position.createBefore( root );
-			} ).to.throwCKEditorError( /model-position-before-root/ );
+			} ).to.throw( CKEditorError, /model-position-before-root/ );
 		} );
 	} );
 
@@ -226,7 +227,7 @@ describe( 'position', () => {
 		it( 'should throw error if one try to make positions after root', () => {
 			expect( () => {
 				Position.createAfter( root );
-			} ).to.throwCKEditorError( /model-position-after-root/ );
+			} ).to.throw( CKEditorError, /model-position-after-root/ );
 		} );
 	} );
 
@@ -762,7 +763,7 @@ describe( 'position', () => {
 				() => {
 					Position.fromJSON( { root: 'noroot', path: [ 0 ] }, doc );
 				}
-			).to.throwCKEditorError( /model-position-fromjson-no-root/ );
+			).to.throw( CKEditorError, /model-position-fromjson-no-root/ );
 		} );
 	} );
 } );

+ 4 - 3
packages/ckeditor5-engine/tests/model/schema/schema.js

@@ -10,6 +10,7 @@ import { SchemaItem as SchemaItem } from '/ckeditor5/engine/model/schema.js';
 import Document from '/ckeditor5/engine/model/document.js';
 import Element from '/ckeditor5/engine/model/element.js';
 import Position from '/ckeditor5/engine/model/position.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import testUtils from '/tests/core/_utils/utils.js';
 
 testUtils.createSinonSandbox();
@@ -70,13 +71,13 @@ describe( 'registerItem', () => {
 
 		expect( () => {
 			schema.registerItem( 'new' );
-		} ).to.throwCKEditorError( /model-schema-item-exists/ );
+		} ).to.throw( CKEditorError, /model-schema-item-exists/ );
 	} );
 
 	it( 'should throw if base item has not been registered in schema', () => {
 		expect( () => {
 			schema.registerItem( 'new', 'old' );
-		} ).to.throwCKEditorError( /model-schema-no-item/ );
+		} ).to.throw( CKEditorError, /model-schema-no-item/ );
 	} );
 } );
 
@@ -102,7 +103,7 @@ describe( '_getItem', () => {
 	it( 'should throw if there is no item registered under given name', () => {
 		expect( () => {
 			schema._getItem( 'new' );
-		} ).to.throwCKEditorError( /model-schema-no-item/ );
+		} ).to.throw( CKEditorError, /model-schema-no-item/ );
 	} );
 } );
 

+ 5 - 4
packages/ckeditor5-engine/tests/model/selection.js

@@ -12,6 +12,7 @@ import Range from '/ckeditor5/engine/model/range.js';
 import Position from '/ckeditor5/engine/model/position.js';
 import LiveRange from '/ckeditor5/engine/model/liverange.js';
 import Selection from '/ckeditor5/engine/model/selection.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import testUtils from '/tests/core/_utils/utils.js';
 import count from '/ckeditor5/utils/count.js';
 
@@ -108,7 +109,7 @@ describe( 'Selection', () => {
 		it( 'should throw an error when range is invalid', () => {
 			expect( () => {
 				selection.addRange( { invalid: 'Range' } );
-			} ).to.throwCKEditorError( /model-selection-added-not-range/ );
+			} ).to.throw( CKEditorError, /model-selection-added-not-range/ );
 		} );
 
 		it( 'should copy added ranges and store multiple ranges', () => {
@@ -178,7 +179,7 @@ describe( 'Selection', () => {
 						new Position( root, [ 1, 2 ] )
 					)
 				);
-			} ).to.throwCKEditorError( /model-selection-range-intersects/ );
+			} ).to.throw( CKEditorError, /model-selection-range-intersects/ );
 		} );
 	} );
 
@@ -314,7 +315,7 @@ describe( 'Selection', () => {
 
 			expect( () => {
 				selection.setFocus( endPos );
-			} ).to.throwCKEditorError( /model-selection-setFocus-no-ranges/ );
+			} ).to.throw( CKEditorError, /model-selection-setFocus-no-ranges/ );
 		} );
 
 		it( 'modifies existing collapsed selection', () => {
@@ -502,7 +503,7 @@ describe( 'Selection', () => {
 		it( 'should throw an error when range is invalid', () => {
 			expect( () => {
 				selection.setRanges( [ { invalid: 'range' } ] );
-			} ).to.throwCKEditorError( /model-selection-added-not-range/ );
+			} ).to.throw( CKEditorError, /model-selection-added-not-range/ );
 		} );
 
 		it( 'should remove all ranges and add given ranges', () => {

+ 5 - 4
packages/ckeditor5-engine/tests/model/textproxy.js

@@ -9,6 +9,7 @@ import Element from '/ckeditor5/engine/model/element.js';
 import Text from '/ckeditor5/engine/model/text.js';
 import TextProxy from '/ckeditor5/engine/model/textproxy.js';
 import Document from '/ckeditor5/engine/model/document.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'TextProxy', () => {
 	let doc, element, textProxy, root, textProxyNoParent, text, textNoParent;
@@ -84,21 +85,21 @@ describe( 'TextProxy', () => {
 	it( 'should throw if wrong offsetInText is passed', () => {
 		expect( () => {
 			new TextProxy( text, -1, 2 );
-		} ).to.throwCKEditorError( /model-textproxy-wrong-offsetintext/ );
+		} ).to.throw( CKEditorError, /model-textproxy-wrong-offsetintext/ );
 
 		expect( () => {
 			new TextProxy( text, 9, 1 );
-		} ).to.throwCKEditorError( /model-textproxy-wrong-offsetintext/ );
+		} ).to.throw( CKEditorError, /model-textproxy-wrong-offsetintext/ );
 	} );
 
 	it( 'should throw if wrong length is passed', () => {
 		expect( () => {
 			new TextProxy( text, 2, -1 );
-		} ).to.throwCKEditorError( /model-textproxy-wrong-length/ );
+		} ).to.throw( CKEditorError, /model-textproxy-wrong-length/ );
 
 		expect( () => {
 			new TextProxy( text, 2, 9 );
-		} ).to.throwCKEditorError( /model-textproxy-wrong-length/ );
+		} ).to.throw( CKEditorError, /model-textproxy-wrong-length/ );
 	} );
 
 	describe( 'getPath', () => {

+ 5 - 4
packages/ckeditor5-engine/tests/model/treewalker.js

@@ -11,6 +11,7 @@ import Text from '/ckeditor5/engine/model/text.js';
 import TreeWalker from '/ckeditor5/engine/model/treewalker.js';
 import Position from '/ckeditor5/engine/model/position.js';
 import Range from '/ckeditor5/engine/model/range.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'TreeWalker', () => {
 	let doc, root, img1, paragraph, ba, r, img2, x;
@@ -49,21 +50,21 @@ describe( 'TreeWalker', () => {
 		it( 'should throw if neither boundaries nor starting position is set', () => {
 			expect( () => {
 				new TreeWalker();
-			} ).to.throwCKEditorError( /^model-tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^model-tree-walker-no-start-position/ );
 
 			expect( () => {
 				new TreeWalker( {} );
-			} ).to.throwCKEditorError( /^model-tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^model-tree-walker-no-start-position/ );
 
 			expect( () => {
 				new TreeWalker( { singleCharacters: true } );
-			} ).to.throwCKEditorError( /^model-tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^model-tree-walker-no-start-position/ );
 		} );
 
 		it( 'should throw if walking direction is unknown', () => {
 			expect( () => {
 				new TreeWalker( { startPosition: rootBeginning, direction: 'unknown' } );
-			} ).to.throwCKEditorError( /^model-tree-walker-unknown-direction/ );
+			} ).to.throw( CKEditorError, /^model-tree-walker-unknown-direction/ );
 		} );
 	} );
 

+ 4 - 2
packages/ckeditor5-engine/tests/model/writer.js

@@ -15,6 +15,8 @@ import Range from '/ckeditor5/engine/model/range.js';
 import writer from '/ckeditor5/engine/model/writer.js';
 import { getData } from '/tests/engine/_utils/model.js';
 
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
+
 let doc, root;
 
 describe( 'writer', () => {
@@ -82,7 +84,7 @@ describe( 'writer', () => {
 		it( 'should throw if given range is not flat', () => {
 			expect( () => {
 				writer.remove( new Range( new Position( root, [ 0 ] ), new Position( root, [ 1, 2 ] ) ) );
-			} ).to.throwCKEditorError( /model-writer-remove-range-not-flat/ );
+			} ).to.throw( CKEditorError, /model-writer-remove-range-not-flat/ );
 		} );
 	} );
 
@@ -116,7 +118,7 @@ describe( 'writer', () => {
 		it( 'should throw if given range is not flat', () => {
 			expect( () => {
 				writer.move( new Range( new Position( root, [ 0 ] ), new Position( root, [ 1, 2 ] ) ), null );
-			} ).to.throwCKEditorError( /model-writer-move-range-not-flat/ );
+			} ).to.throw( CKEditorError, /model-writer-move-range-not-flat/ );
 		} );
 	} );
 

+ 2 - 1
packages/ckeditor5-engine/tests/view/node.js

@@ -9,6 +9,7 @@ import Element from '/ckeditor5/engine/view/element.js';
 import Text from '/ckeditor5/engine/view/text.js';
 import DocumentFragment from '/ckeditor5/engine/view/documentfragment.js';
 import RootEditableElement from '/ckeditor5/engine/view/rooteditableelement.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 import createDocumentMock from '/tests/engine/view/_utils/createdocumentmock.js';
 
@@ -136,7 +137,7 @@ describe( 'Node', () => {
 				() => {
 					f.index;
 				}
-			).to.throwCKEditorError( /view-node-not-found-in-parent/ );
+			).to.throw( CKEditorError, /view-node-not-found-in-parent/ );
 		} );
 	} );
 

+ 4 - 2
packages/ckeditor5-engine/tests/view/position.js

@@ -14,6 +14,8 @@ import Document from '/ckeditor5/engine/view/document.js';
 import Text from '/ckeditor5/engine/view/text.js';
 import TextProxy from '/ckeditor5/engine/view/textproxy.js';
 
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
+
 import { parse } from '/tests/engine/_utils/view.js';
 
 describe( 'Position', () => {
@@ -401,7 +403,7 @@ describe( 'Position', () => {
 		it( 'should throw error if one try to create positions before root', () => {
 			expect( () => {
 				Position.createBefore( parse( '<p></p>' ) );
-			} ).to.throwCKEditorError( /view-position-before-root/ );
+			} ).to.throw( CKEditorError, /view-position-before-root/ );
 		} );
 
 		it( 'should create positions before `Node`', () => {
@@ -426,7 +428,7 @@ describe( 'Position', () => {
 		it( 'should throw error if one try to create positions after root', () => {
 			expect( () => {
 				Position.createAfter( parse( '<p></p>' ) );
-			} ).to.throwCKEditorError( /view-position-after-root/ );
+			} ).to.throw( CKEditorError, /view-position-after-root/ );
 		} );
 
 		it( 'should create positions after `Node`', () => {

+ 2 - 1
packages/ckeditor5-engine/tests/view/renderer.js

@@ -12,6 +12,7 @@ import ViewRange from '/ckeditor5/engine/view/range.js';
 import Selection from '/ckeditor5/engine/view/selection.js';
 import DomConverter from '/ckeditor5/engine/view/domconverter.js';
 import Renderer from '/ckeditor5/engine/view/renderer.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import { parse } from '/tests/engine/_utils/view.js';
 import { INLINE_FILLER, INLINE_FILLER_LENGTH, isBlockFiller, BR_FILLER } from '/ckeditor5/engine/view/filler.js';
 import testUtils from '/tests/core/_utils/utils.js';
@@ -97,7 +98,7 @@ describe( 'Renderer', () => {
 		it( 'should throw if the type is unknown', () => {
 			expect( () => {
 				renderer.markToSync( 'UNKNOWN', viewRoot );
-			} ).to.throwCKEditorError( /^view-renderer-unknown-type/ );
+			} ).to.throw( CKEditorError, /^view-renderer-unknown-type/ );
 		} );
 	} );
 

+ 5 - 4
packages/ckeditor5-engine/tests/view/selection.js

@@ -11,6 +11,7 @@ import Document from '/ckeditor5/engine/view/document.js';
 import Element from '/ckeditor5/engine/view/element.js';
 import Text from '/ckeditor5/engine/view/text.js';
 import Position from '/ckeditor5/engine/view/position.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'Selection', () => {
 	let selection;
@@ -146,7 +147,7 @@ describe( 'Selection', () => {
 		it( 'should throw an error when range is invalid', () => {
 			expect( () => {
 				selection.addRange( { invalid: 'range' } );
-			} ).to.throwCKEditorError( 'view-selection-invalid-range: Invalid Range.' );
+			} ).to.throw( CKEditorError, 'view-selection-invalid-range: Invalid Range.' );
 		} );
 
 		it( 'should add range to selection ranges', () => {
@@ -168,11 +169,11 @@ describe( 'Selection', () => {
 			selection.addRange( range1 );
 			expect( () => {
 				selection.addRange( range2 );
-			} ).to.throwCKEditorError( 'view-selection-range-intersects' );
+			} ).to.throw( CKEditorError, 'view-selection-range-intersects' );
 
 			expect( () => {
 				selection.addRange( range1 );
-			} ).to.throwCKEditorError( 'view-selection-range-intersects' );
+			} ).to.throw( CKEditorError, 'view-selection-range-intersects' );
 		} );
 	} );
 
@@ -336,7 +337,7 @@ describe( 'Selection', () => {
 		it( 'should throw an error when range is invalid', () => {
 			expect( () => {
 				selection.setRanges( [ { invalid: 'range' } ] );
-			} ).to.throwCKEditorError( 'view-selection-invalid-range: Invalid Range.' );
+			} ).to.throw( CKEditorError, 'view-selection-invalid-range: Invalid Range.' );
 		} );
 
 		it( 'should add ranges and fire change event', ( done ) => {

+ 5 - 4
packages/ckeditor5-engine/tests/view/textproxy.js

@@ -10,6 +10,7 @@ import Text from '/ckeditor5/engine/view/text.js';
 import ContainerElement from '/ckeditor5/engine/view/containerelement.js';
 import DocumentFragment from '/ckeditor5/engine/view/documentfragment.js';
 import RootEditableElement from '/ckeditor5/engine/view/rooteditableelement.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 import createDocumentMock from '/tests/engine/view/_utils/createdocumentmock.js';
 
@@ -44,21 +45,21 @@ describe( 'TextProxy', () => {
 		it( 'should throw if wrong offsetInText is passed', () => {
 			expect( () => {
 				new TextProxy( text, -1, 2 );
-			} ).to.throwCKEditorError( /view-textproxy-wrong-offsetintext/ );
+			} ).to.throw( CKEditorError, /view-textproxy-wrong-offsetintext/ );
 
 			expect( () => {
 				new TextProxy( text, 9, 1 );
-			} ).to.throwCKEditorError( /view-textproxy-wrong-offsetintext/ );
+			} ).to.throw( CKEditorError, /view-textproxy-wrong-offsetintext/ );
 		} );
 
 		it( 'should throw if wrong length is passed', () => {
 			expect( () => {
 				new TextProxy( text, 2, -1 );
-			} ).to.throwCKEditorError( /view-textproxy-wrong-length/ );
+			} ).to.throw( CKEditorError, /view-textproxy-wrong-length/ );
 
 			expect( () => {
 				new TextProxy( text, 2, 9 );
-			} ).to.throwCKEditorError( /view-textproxy-wrong-length/ );
+			} ).to.throw( CKEditorError, /view-textproxy-wrong-length/ );
 		} );
 	} );
 

+ 5 - 4
packages/ckeditor5-engine/tests/view/treewalker.js

@@ -13,6 +13,7 @@ import Text from '/ckeditor5/engine/view/text.js';
 import TreeWalker from '/ckeditor5/engine/view/treewalker.js';
 import Position from '/ckeditor5/engine/view/position.js';
 import Range from '/ckeditor5/engine/view/range.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'TreeWalker', () => {
 	let doc, root, img1, paragraph, bold, textAbcd, charY, img2, charX;
@@ -56,21 +57,21 @@ describe( 'TreeWalker', () => {
 		it( 'should throw if neither boundaries nor starting position is set', () => {
 			expect( () => {
 				new TreeWalker();
-			} ).to.throwCKEditorError( /^view-tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^view-tree-walker-no-start-position/ );
 
 			expect( () => {
 				new TreeWalker( {} );
-			} ).to.throwCKEditorError( /^view-tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^view-tree-walker-no-start-position/ );
 
 			expect( () => {
 				new TreeWalker( { singleCharacters: true } );
-			} ).to.throwCKEditorError( /^view-tree-walker-no-start-position/ );
+			} ).to.throw( CKEditorError, /^view-tree-walker-no-start-position/ );
 		} );
 
 		it( 'should throw if walking direction is unknown', () => {
 			expect( () => {
 				new TreeWalker( { startPosition: rootBeginning, direction: 'unknown' } );
-			} ).to.throwCKEditorError( /^view-tree-walker-unknown-direction/ );
+			} ).to.throw( CKEditorError, /^view-tree-walker-unknown-direction/ );
 		} );
 	} );
 

+ 3 - 2
packages/ckeditor5-engine/tests/view/writer/breakrange.js

@@ -10,6 +10,7 @@ import ContainerElement from '/ckeditor5/engine/view/containerelement.js';
 import AttributeElement from '/ckeditor5/engine/view/attributeelement.js';
 import Range from '/ckeditor5/engine/view/range.js';
 import { stringify, parse } from '/tests/engine/_utils/view.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'writer', () => {
 	/**
@@ -32,7 +33,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				breakRange( Range.createFromParentsAndOffsets( p1, 0, p2, 0 ) );
-			} ).to.throwCKEditorError( 'view-writer-invalid-range-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-range-container' );
 		} );
 
 		it( 'should throw when range has no parent container', () => {
@@ -40,7 +41,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				breakRange( Range.createFromParentsAndOffsets( el, 0, el, 0 ) );
-			} ).to.throwCKEditorError( 'view-writer-invalid-range-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-range-container' );
 		} );
 
 		it( 'should not break text nodes if they are not in attribute elements', () => {

+ 4 - 3
packages/ckeditor5-engine/tests/view/writer/insert.js

@@ -9,6 +9,7 @@ import { insert } from '/ckeditor5/engine/view/writer.js';
 import ContainerElement from '/ckeditor5/engine/view/containerelement.js';
 import Element from '/ckeditor5/engine/view/element.js';
 import Position from '/ckeditor5/engine/view/position.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import { stringify, parse } from '/tests/engine/_utils/view.js';
 import AttributeElement from '/ckeditor5/engine/view/attributeelement.js';
 
@@ -151,7 +152,7 @@ describe( 'writer', () => {
 			const position = new Position( container, 0 );
 			expect( () => {
 				insert( position, element );
-			} ).to.throwCKEditorError( 'view-writer-insert-invalid-node' );
+			} ).to.throw( CKEditorError, 'view-writer-insert-invalid-node' );
 		} );
 
 		it( 'should throw when Element is inserted as child node', () => {
@@ -162,7 +163,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				insert( position, root );
-			} ).to.throwCKEditorError( 'view-writer-insert-invalid-node' );
+			} ).to.throw( CKEditorError, 'view-writer-insert-invalid-node' );
 		} );
 
 		it( 'should throw when position is not placed inside container', () => {
@@ -172,7 +173,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				insert( position, attributeElement );
-			} ).to.throwCKEditorError( 'view-writer-invalid-position-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-position-container' );
 		} );
 	} );
 } );

+ 3 - 2
packages/ckeditor5-engine/tests/view/writer/remove.js

@@ -11,6 +11,7 @@ import Range from '/ckeditor5/engine/view/range.js';
 import DocumentFragment from '/ckeditor5/engine/view/documentfragment.js';
 import { stringify, parse } from '/tests/engine/_utils/view.js';
 import AttributeElement from '/ckeditor5/engine/view/attributeelement.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 
 describe( 'writer', () => {
 	/**
@@ -37,7 +38,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				remove( Range.createFromParentsAndOffsets( p1, 0, p2, 0 ) );
-			} ).to.throwCKEditorError( 'view-writer-invalid-range-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-range-container' );
 		} );
 
 		it( 'should throw when range has no parent container', () => {
@@ -45,7 +46,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				remove( Range.createFromParentsAndOffsets( el, 0, el, 0 ) );
-			} ).to.throwCKEditorError( 'view-writer-invalid-range-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-range-container' );
 		} );
 
 		it( 'should return empty DocumentFragment when range is collapsed', () => {

+ 4 - 3
packages/ckeditor5-engine/tests/view/writer/unwrap.js

@@ -12,6 +12,7 @@ import AttributeElement from '/ckeditor5/engine/view/attributeelement.js';
 import Position from '/ckeditor5/engine/view/position.js';
 import Range from '/ckeditor5/engine/view/range.js';
 import Text from '/ckeditor5/engine/view/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import { stringify, parse } from '/tests/engine/_utils/view.js';
 
 describe( 'writer', () => {
@@ -56,7 +57,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				unwrap( range, b );
-			} ).to.throwCKEditorError( 'view-writer-unwrap-invalid-attribute' );
+			} ).to.throw( CKEditorError, 'view-writer-unwrap-invalid-attribute' );
 		} );
 
 		it( 'should throw error when range placed in two containers', () => {
@@ -70,7 +71,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				unwrap( range, b );
-			} ).to.throwCKEditorError( 'view-writer-invalid-range-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-range-container' );
 		} );
 
 		it( 'should throw when range has no parent container', () => {
@@ -79,7 +80,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				unwrap( Range.createFromParentsAndOffsets( el, 0, el, 0 ), b );
-			} ).to.throwCKEditorError( 'view-writer-invalid-range-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-range-container' );
 		} );
 
 		it( 'should unwrap single node', () => {

+ 4 - 3
packages/ckeditor5-engine/tests/view/writer/wrap.js

@@ -12,6 +12,7 @@ import AttributeElement from '/ckeditor5/engine/view/attributeelement.js';
 import Position from '/ckeditor5/engine/view/position.js';
 import Range from '/ckeditor5/engine/view/range.js';
 import Text from '/ckeditor5/engine/view/text.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import { stringify, parse } from '/tests/engine/_utils/view.js';
 
 describe( 'writer', () => {
@@ -64,7 +65,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				wrap( range, b );
-			} ).to.throwCKEditorError( 'view-writer-wrap-invalid-attribute' );
+			} ).to.throw( CKEditorError, 'view-writer-wrap-invalid-attribute' );
 		} );
 
 		it( 'should throw error when range placed in two containers', () => {
@@ -78,7 +79,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				wrap( range, b );
-			} ).to.throwCKEditorError( 'view-writer-invalid-range-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-range-container' );
 		} );
 
 		it( 'should throw when range has no parent container', () => {
@@ -87,7 +88,7 @@ describe( 'writer', () => {
 
 			expect( () => {
 				wrap( Range.createFromParentsAndOffsets( el, 0, el, 0 ), b );
-			} ).to.throwCKEditorError( 'view-writer-invalid-range-container' );
+			} ).to.throw( CKEditorError, 'view-writer-invalid-range-container' );
 		} );
 
 		it( 'wraps part of a single text node #1', () => {

+ 2 - 1
packages/ckeditor5-engine/tests/view/writer/wrapposition.js

@@ -10,6 +10,7 @@ import Text from '/ckeditor5/engine/view/text.js';
 import Element from '/ckeditor5/engine/view/element.js';
 import ContainerElement from '/ckeditor5/engine/view/containerelement.js';
 import Position from '/ckeditor5/engine/view/position.js';
+import CKEditorError from '/ckeditor5/utils/ckeditorerror.js';
 import { stringify, parse } from '/tests/engine/_utils/view.js';
 
 describe( 'wrapPosition', () => {
@@ -34,7 +35,7 @@ describe( 'wrapPosition', () => {
 
 		expect( () => {
 			wrapPosition( position, b );
-		} ).to.throwCKEditorError( 'view-writer-wrap-invalid-attribute' );
+		} ).to.throw( CKEditorError, 'view-writer-wrap-invalid-attribute' );
 	} );
 
 	it( 'should wrap position at the beginning of text node', () => {