daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top