log.js 584 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* global describe, it */
  6. 'use strict';
  7. const sinon = require( 'sinon' );
  8. const log = require( '../../utils/log' );
  9. describe( 'log', () => {
  10. it( 'should log using configured functions', () => {
  11. const outFn = sinon.spy();
  12. const errFn = sinon.spy();
  13. log.configure( outFn, errFn );
  14. log.out( 'output' );
  15. log.err( 'error' );
  16. sinon.assert.calledWithExactly( outFn, 'output' );
  17. sinon.assert.calledWithExactly( errFn, 'error' );
  18. } );
  19. } );