Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Replace logger.warn with console.warn.
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun committed Jul 19, 2019
1 parent 441c597 commit 83d552f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/adapters/simpleuploadadapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
* @module upload/adapters/simpleuploadadapter
*/

/* globals XMLHttpRequest, FormData */
/* globals XMLHttpRequest, FormData, console */

import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import FileRepository from '../filerepository';
import log from '@ckeditor/ckeditor5-utils/src/log';
import { attachLinkToDocumentation } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';

/**
* The Simple upload adapter allows uploading images to an application running on your server using
Expand Down Expand Up @@ -71,9 +71,9 @@ export default class SimpleUploadAdapter extends Plugin {
*
* @error simple-upload-adapter-missing-uploadUrl
*/
log.warn(
console.warn( attachLinkToDocumentation(
'simple-upload-adapter-missing-uploadUrl: Missing the "uploadUrl" property in the "simpleUpload" editor configuration.'
);
) );

return;
}
Expand Down
11 changes: 5 additions & 6 deletions tests/adapters/simpleuploadadapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/* globals document */
/* globals document, console */

import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
import SimpleUploadAdapter from '../../src/adapters/simpleuploadadapter';
import FileRepository from '../../src/filerepository';
import log from '@ckeditor/ckeditor5-utils/src/log';
import { createNativeFileMock } from '../_utils/mocks';
import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';

describe( 'SimpleUploadAdapter', () => {
let editor, editorElement, sinonXHR, logStub, fileRepository;
let editor, editorElement, sinonXHR, consoleWarnStub, fileRepository;

testUtils.createSinonSandbox();

Expand All @@ -22,7 +21,7 @@ describe( 'SimpleUploadAdapter', () => {
document.body.appendChild( editorElement );

sinonXHR = testUtils.sinon.useFakeServer();
logStub = testUtils.sinon.stub( log, 'warn' );
consoleWarnStub = testUtils.sinon.stub( console, 'warn' );

return ClassicTestEditor
.create( editorElement, {
Expand Down Expand Up @@ -116,8 +115,8 @@ describe( 'SimpleUploadAdapter', () => {
}
} )
.then( editor => {
expect( logStub.callCount ).to.equal( 1 );
expect( logStub.firstCall.args[ 0 ] ).to.match( /^simple-upload-adapter-missing-uploadUrl/ );
expect( consoleWarnStub.callCount ).to.equal( 1 );
expect( consoleWarnStub.firstCall.args[ 0 ] ).to.match( /^simple-upload-adapter-missing-uploadUrl/ );

const fileRepository = editor.plugins.get( FileRepository );

Expand Down

0 comments on commit 83d552f

Please sign in to comment.