Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as Funcs from './Funcs'
- describe('funcA', () => {
- it('calls funcB', () => {
- jest.spyOn(Funcs, 'funcB')
- Funcs.funcA()
- expect(Funcs.funcB).toHaveBeenCalled()
- }
- }
- export const funcA = () => {
- funcB()
- }
- export const funcB = () => {}
- import { funcB } from './b';
- export const funcA = () => {
- funcB()
- }
- var _b = require('./b');
- var funcA = exports.funcA = function funcA() {
- (0, _b.funcB)();
- };
- exports.funcA = () => {
- exports.funcB();
- };
- exports.funcB = () => {};
- const fns = require("./fns");
- describe("funcA", () => {
- it("calls funcB", () => {
- fns.funcB = jest.fn();
- fns.funcA();
- expect(fns.funcB).toBeCalled();
- });
- });
Add Comment
Please, Sign In to add comment