diff --git a/__tests__/hash.ts b/__tests__/hash.ts index 7c5324c1cc..bd2999103a 100644 --- a/__tests__/hash.ts +++ b/__tests__/hash.ts @@ -7,6 +7,7 @@ /// +import * as moment from 'moment'; import * as jasmineCheck from 'jasmine-check'; jasmineCheck.install(); @@ -62,4 +63,12 @@ describe('hash', () => { expect(hashVal).toBeGreaterThan(-Math.pow(2, 31)); expect(hashVal).toBeLessThan(Math.pow(2, 31)); }); + + it('should work with moment objects', () => { + const now = moment(); + console.log(now); + + const nowHash = hash(now); + expect(typeof nowHash).toBe('number'); + }); }); diff --git a/package.json b/package.json index 25f6f9299c..56d4ea18bd 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "marked": "1.2.3", "microtime": "^3.0.0", "mkdirp": "0.5.1", + "moment": "^2.29.1", "npm-run-all": "4.1.5", "prettier": "^2.1.2", "prop-types": "15.6.2", diff --git a/yarn.lock b/yarn.lock index 0b1c57f79d..d7c8d8d07b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6918,6 +6918,11 @@ module-deps@^6.0.0: through2 "^2.0.0" xtend "^4.0.0" +moment@^2.29.1: + version "2.29.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" + integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"