Skip to content

Commit

Permalink
add condition
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKamaev committed May 28, 2018
1 parent 4155a9b commit 2e51e75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/moment-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ try {
sideMomentModulePath = resolveFrom(momentDurationFormatPath, 'moment');
}
catch (err) {
//
}

if (sideMomentModulePath && sideMomentModulePath !== testcafeMomentModulePath) {
Expand All @@ -33,7 +34,8 @@ if (sideMomentModulePath && sideMomentModulePath !== testcafeMomentModulePath) {
else {
const momentDurationFormatSetup = require(momentDurationFormatPath);

momentDurationFormatSetup(moment);
if (!sideMomentModulePath)
momentDurationFormatSetup(moment);
}

restoreInitialCacheState(testcafeOriginalMomentModule, testcafeMomentModulePath);
Expand Down

0 comments on commit 2e51e75

Please # to comment.