spy.js 552 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. import spy from '/ckeditor5/utils/spy.js';
  7. describe( 'utils', () => {
  8. describe( 'spy', () => {
  9. it( 'should not have `called` after creation', () => {
  10. let fn = spy();
  11. expect( fn.called ).to.not.be.true;
  12. } );
  13. it( 'should register calls', () => {
  14. let fn1 = spy();
  15. let fn2 = spy();
  16. fn1();
  17. expect( fn1.called ).to.be.true;
  18. expect( fn2.called ).to.not.be.true;
  19. } );
  20. } );
  21. } );