Guest User

Untitled

a guest
Apr 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. var spy = jasmine.createSpy('spy');
  2. ...
  3. expect(spy).toHaveBeenCalled();
  4.  
  5. it("sandbox playground", function() {
  6. var twin1 = jasmine.createSpy('twin brother').and.returnValue({});
  7. var twin2 = jasmine.createSpy('twin brother').and.returnValue({});
  8. var unnamed = jasmine.createSpy(undefined).and.returnValue({});
  9. var skipped = jasmine.createSpy().and.returnValue({});
  10. expect(twin1).toHaveBeenCalled();
  11. expect(twin2).toHaveBeenCalled();
  12. expect(unnamed).toHaveBeenCalled();
  13. expect(skipped).toHaveBeenCalled();
  14. });
  15.  
  16. Firefox 56.0.0 (Windows 7 0.0.0) Sample Tests. sandbox playground FAILED
  17. Expected spy twin brother to have been called.
  18. @tests/sampleTests.spec.js:37:9
  19. Expected spy twin brother to have been called.
  20. @tests/sampleTests.spec.js:38:9
  21. Expected spy unknown to have been called.
  22. @tests/sampleTests.spec.js:39:9
  23. Expected spy unknown to have been called.
  24. @tests/sampleTests.spec.js:40:9
Add Comment
Please, Sign In to add comment