mardi 13 septembre 2016

How to spy on function from another module

I have two functions in one module:

export function foo() {
  console.log('foo');
}

export function bar() {
  foo()
}

Now I want to test bar(), set a spy on foo() and assert for it to be called. How can this be achieved?

Aucun commentaire:

Enregistrer un commentaire