Maciej Bukowski преди 6 години
родител
ревизия
ce576047ff
променени са 2 файла, в които са добавени 3 реда и са изтрити 6 реда
  1. 2 3
      packages/ckeditor5-core/tests/_utils-tests/classictesteditor.js
  2. 1 3
      packages/ckeditor5-core/tests/plugincollection.js

+ 2 - 3
packages/ckeditor5-core/tests/_utils-tests/classictesteditor.js

@@ -22,7 +22,7 @@ import RootElement from '@ckeditor/ckeditor5-engine/src/model/rootelement';
 
 import { getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import testUtils from '../../tests/_utils/utils';
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+import { assertCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
 describe( 'ClassicTestEditor', () => {
 	let editorElement;
@@ -225,8 +225,7 @@ describe( 'ClassicTestEditor', () => {
 				.then( () => {
 					throw new Error( 'It should throw an error' );
 				}, err => {
-					expect( err.message ).to.match( /^editor-create-initial-data:/ );
-					expect( err ).to.be.instanceOf( CKEditorError );
+					assertCKEditorError( err, /^editor-create-initial-data:/, null );
 				} );
 		} );
 	} );

+ 1 - 3
packages/ckeditor5-core/tests/plugincollection.js

@@ -9,7 +9,6 @@ import testUtils from '../tests/_utils/utils';
 import Editor from '../src/editor/editor';
 import PluginCollection from '../src/plugincollection';
 import Plugin from '../src/plugin';
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import log from '@ckeditor/ckeditor5-utils/src/log';
 import { expectToThrowCKEditorError, assertCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
@@ -270,8 +269,7 @@ describe( 'PluginCollection', () => {
 					throw new Error( 'Test error: this promise should not be resolved successfully' );
 				} )
 				.catch( err => {
-					expect( err ).to.be.an.instanceof( CKEditorError );
-					expect( err.message ).to.match( /^plugincollection-plugin-not-found/ );
+					assertCKEditorError( err, /^plugincollection-plugin-not-found/, null );
 
 					sinon.assert.calledOnce( logSpy );
 					expect( logSpy.args[ 0 ][ 0 ] ).to.match( /^plugincollection-plugin-not-found:/ );