fix conditional
This commit is contained in:
parent
1cbbbd6989
commit
cb2871d377
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/i18n",
|
"name": "@ohif/i18n",
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"description": "OHIF extension for internationalization",
|
"description": "OHIF extension for internationalization",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@ -31,10 +31,10 @@ function getKeyForNameSpaces(key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getLocales() {
|
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
|
// require.context is exclusive from webpack. This conditional is needed to escape while running tests
|
||||||
if (!isWebpackEnv) {
|
if (isTestEnvironment) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user