Guest User

Untitled

a guest
Jun 14th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import * as Funcs from './Funcs'
  2. describe('funcA', () => {
  3. it('calls funcB', () => {
  4. jest.spyOn(Funcs, 'funcB')
  5. Funcs.funcA()
  6. expect(Funcs.funcB).toHaveBeenCalled()
  7. }
  8. }
  9.  
  10. export const funcA = () => {
  11. funcB()
  12. }
  13. export const funcB = () => {}
  14.  
  15. import { funcB } from './b';
  16.  
  17. export const funcA = () => {
  18. funcB()
  19. }
  20.  
  21. var _b = require('./b');
  22.  
  23. var funcA = exports.funcA = function funcA() {
  24. (0, _b.funcB)();
  25. };
  26.  
  27. exports.funcA = () => {
  28. exports.funcB();
  29. };
  30. exports.funcB = () => {};
  31.  
  32. const fns = require("./fns");
  33.  
  34. describe("funcA", () => {
  35. it("calls funcB", () => {
  36. fns.funcB = jest.fn();
  37. fns.funcA();
  38. expect(fns.funcB).toBeCalled();
  39. });
  40. });
Add Comment
Please, Sign In to add comment