Need to use unibabel in node for test #2
Rótulos
Sem rótulo
Sem etapa
Sem encarregados
2 Participantes
Notificações
Data de vencimento
Sem data de vencimento definida.
Dependências
Não estão definidas dependências.
Referência: coolaj86/unibabel.js#2
Carregando…
Criar uma nova questão referindo esta
Nenhuma descrição fornecida.
Eliminar o ramo "%!s(<nil>)"
Eliminar um ramo é algo permanente. Embora o ramo eliminado possa continuar a existir por um breve período de tempo antes de ser realmente removido, a operação NÃO PODERÁ ser desfeita na maioria dos casos. Quer continuar?
Unibabel endup in my node stack because I use jest and jest run in node. In fact most js unit testing library run in node, not the browser. Only exception I know of is karma.
Let's forget the incompatibility with node for a moment.
Jest allows to mock any dependencies at the import level. But since an error is thrown as soon as unibabel is imported, it's impossible to mock unibabel with jest.
Only thing I could do was to use require inside the function that uses it.
Also, jest use jsdom to emulate the browser api. So I maybe wrong, but I think unibabel would work with jest.
Hey @ThieryMichel,
Sorry for the long wait. I've published unibabel@v3.0.0 (tagged as next rather than latest on npm) and it now supports node.
Would you mind giving it a try and letting me know if it works for you?
Hey @coolaj86,
It works great, thanks.