diff --git a/extensions/ohif-i18n/package.json b/extensions/ohif-i18n/package.json index e6b49d9f8..ee43842a0 100644 --- a/extensions/ohif-i18n/package.json +++ b/extensions/ohif-i18n/package.json @@ -1,6 +1,6 @@ { "name": "@ohif/i18n", - "version": "0.0.3", + "version": "0.0.4", "description": "OHIF extension for internationalization", "author": "OHIF", "license": "MIT", diff --git a/extensions/ohif-i18n/src/index.js b/extensions/ohif-i18n/src/index.js index eb4f693e9..f0b297f41 100755 --- a/extensions/ohif-i18n/src/index.js +++ b/extensions/ohif-i18n/src/index.js @@ -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 {}; }