6
Como zombar das importações de um módulo ES6?
Eu tenho os seguintes módulos ES6: network.js export function getDataFromServer() { return ... } widget.js import { getDataFromServer } from 'network.js'; export class Widget() { constructor() { getDataFromServer("dataForWidget") .then(data => this.render(data)); } render() { ... } } Estou procurando uma maneira de testar o Widget com uma instância simulada de …