spy.js 524 B

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