Skip to content

Commit

Permalink
Merge pull request #6 from iamakulov/test-updates
Browse files Browse the repository at this point in the history
Run real webpack in tests + upgrade webpack and Moment.js
  • Loading branch information
iamakulov authored Mar 24, 2018
2 parents 8fd6094 + a7f39df commit e2fc2ba
Show file tree
Hide file tree
Showing 9 changed files with 8,255 additions and 5,429 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ function normalizeLocalesToKeep(localesToKeep) {

// Check if has unknown locales
var absentLocales = localesToKeep.filter(function(localeName) {
return moment.localeData(localeName) === null;
const localeData = moment.localeData(localeName);
return (
// For Moment 2.20.1−
localeData === null ||
// For Moment. 2.21.0+ – this version now returns a default locale instead of null
localeData === moment.localeData()
);
});
if (absentLocales.length > 0) {
throw new Error(
Expand Down
54 changes: 0 additions & 54 deletions index.test.js

This file was deleted.

Loading

0 comments on commit e2fc2ba

Please sign in to comment.