Skip to content

Commit

Permalink
Make the moment loader works in Jest env (closes DevExpress#2500)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyBelym committed Sep 4, 2018
1 parent 111289d commit faef1c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/moment-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ function getCachedAndCleanModules (modulePath) {

delete require.cache[modulePath];

require(modulePath);
const cleanModuleExports = require(modulePath);
const cleanModule = require.cache[modulePath] || { exports: cleanModuleExports };

return { cachedModule, cleanModule: require.cache[modulePath] };
return { cachedModule, cleanModule };
}

function getMomentModules ({ mainMomentModulePath, sideMomentModulePath }) {
Expand Down

0 comments on commit faef1c2

Please sign in to comment.