fix conditional

This commit is contained in:
Rodrigo Antinarelli 2019-06-13 15:30:13 -03:00
parent e90041ccd6
commit ea3142c1ea

View File

@ -31,7 +31,8 @@ function getKeyForNameSpaces(key) {
}
function getLocales() {
const isWebpackEnv = typeof require.context === 'function';
const isWebpackEnv = !!require.context('./locales', true, /\.json$/);
// require.context is exclusive from webpack, it's needed to escape inside jest
if (!isWebpackEnv) {
return {};