From ea3142c1ea440e6f6cccf7dd4518134770918653 Mon Sep 17 00:00:00 2001 From: Rodrigo Antinarelli Date: Thu, 13 Jun 2019 15:30:13 -0300 Subject: [PATCH] fix conditional --- extensions/ohif-i18n/src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/ohif-i18n/src/index.js b/extensions/ohif-i18n/src/index.js index f11da3c37..eb4f693e9 100755 --- a/extensions/ohif-i18n/src/index.js +++ b/extensions/ohif-i18n/src/index.js @@ -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 {};