Selaa lähdekoodia

Tests: Stubbed console warning. Part of ckeditor/ckeditor5#1996.

Marek Lewandowski 6 vuotta sitten
vanhempi
commit
e154129d5e
1 muutettua tiedostoa jossa 8 lisäystä ja 4 poistoa
  1. 8 4
      packages/ckeditor5-utils/tests/locale.js

+ 8 - 4
packages/ckeditor5-utils/tests/locale.js

@@ -6,17 +6,18 @@
 /* globals console */
 
 import Locale from '../src/locale';
-import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 
 describe( 'Locale', () => {
 	let locale;
 
-	testUtils.createSinonSandbox();
-
 	beforeEach( () => {
 		locale = new Locale();
 	} );
 
+	afterEach( () => {
+		sinon.restore();
+	} );
+
 	describe( 'constructor', () => {
 		it( 'sets the #language', () => {
 			const locale = new Locale( {
@@ -149,11 +150,14 @@ describe( 'Locale', () => {
 
 	describe( 'language()', () => {
 		it( 'should return #uiLanguage', () => {
+			const stub = sinon.stub( console, 'warn' );
+
 			expect( locale.language ).to.equal( locale.uiLanguage );
+			sinon.assert.calledWithMatch( stub, 'locale-deprecated-language-property' );
 		} );
 
 		it( 'should warn about deprecation', () => {
-			const stub = testUtils.sinon.stub( console, 'warn' );
+			const stub = sinon.stub( console, 'warn' );
 
 			expect( locale.language ).to.equal( 'en' );
 			sinon.assert.calledWithMatch( stub, 'locale-deprecated-language-property' );