spy.js 580 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. import spy from '../src/spy';
  6. describe( 'utils', () => {
  7. describe( 'spy', () => {
  8. it( 'should not have `called` after creation', () => {
  9. const fn = spy();
  10. expect( fn.called ).to.not.be.true;
  11. } );
  12. it( 'should register calls', () => {
  13. const fn1 = spy();
  14. const fn2 = spy();
  15. fn1();
  16. expect( fn1.called ).to.be.true;
  17. expect( fn2.called ).to.not.be.true;
  18. } );
  19. } );
  20. } );