【发布时间】:2020-05-12 01:11:36
【问题描述】:
在 Jest 中测试 IntL 货币转换时,我没有得到正确的转换。
我的测试:
expect(new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(50.00)).toBe('R$ 50,00');
// Expected value to be:
// "R$ 50,00"
// Received:
// "R$ 50.00"
我的命令:
jest --config test/unit/jest.conf.js
如何将正确的语言环境配置设置为 Jest?
【问题讨论】:
标签: javascript unit-testing testing internationalization jestjs