fix conditional

This commit is contained in:
Rodrigo Antinarelli 2019-06-13 16:20:29 -03:00
parent 1cbbbd6989
commit cb2871d377
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@ohif/i18n",
"version": "0.0.3",
"version": "0.0.4",
"description": "OHIF extension for internationalization",
"author": "OHIF",
"license": "MIT",

View File

@ -31,10 +31,10 @@ function getKeyForNameSpaces(key) {
}
function getLocales() {
const isWebpackEnv = !!require.context('./locales', true, /\.json$/);
var isTestEnvironment = process.env.NODE_ENV === 'test';
// require.context is exclusive from webpack, it's needed to escape inside jest
if (!isWebpackEnv) {
// require.context is exclusive from webpack. This conditional is needed to escape while running tests
if (isTestEnvironment) {
return {};
}