diff --git a/package.json b/package.json index 3a5844a31..5bf6fc405 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "jsdom": "^16.2.2", "jsdom-global": "^3.0.2", "lerna": "^3.22.0", - "moment-timezone": "^0.5.31", "ts-jest": "^26.1.0", "typescript": "^3.9.5" }, diff --git a/packages/common/package.json b/packages/common/package.json index 054f8d5fa..f4ec9fafd 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -75,7 +75,6 @@ "copyfiles": "^2.3.0", "cross-env": "^7.0.2", "mini-css-extract-plugin": "^0.9.0", - "moment-timezone": "^0.5.31", "node-sass": "4.14.1", "nodemon": "^2.0.4", "npm-run-all": "^4.1.5", diff --git a/packages/common/src/formatters/__tests__/dateIsoFormatter.spec.ts b/packages/common/src/formatters/__tests__/dateIsoFormatter.spec.ts index 2ad7513cc..7d56d7a41 100644 --- a/packages/common/src/formatters/__tests__/dateIsoFormatter.spec.ts +++ b/packages/common/src/formatters/__tests__/dateIsoFormatter.spec.ts @@ -1,5 +1,3 @@ -import * as moment from 'moment-timezone'; - import { Column } from '../../interfaces/index'; import { Formatters } from '../index'; @@ -29,9 +27,7 @@ describe('the Date ISO Formatter', () => { }); it('should return a formatted date value without time date provided has TZ but we specifically mention to parse as UTC ', () => { - moment.tz.setDefault('America/New_York'); - // @ts-ignore - const value = moment('2099-12-31T00:00:00.000Z'); + const value = new Date('2099-12-31T00:00:00.000Z'); const result1 = Formatters.dateIso(0, 0, value, { params: { parseDateAsUtc: true } } as Column, {}); const result2 = Formatters.dateIso(0, 0, value, { params: { parseDateAsUtc: false } } as Column, {}); diff --git a/test/jest-global-setup.js b/test/jest-global-setup.js new file mode 100644 index 000000000..2d22d08e6 --- /dev/null +++ b/test/jest-global-setup.js @@ -0,0 +1,3 @@ +module.exports = async () => { + process.env.TZ = 'EST'; +}; diff --git a/test/jest.config.js b/test/jest.config.js index 249c4cc4d..520ef24a0 100644 --- a/test/jest.config.js +++ b/test/jest.config.js @@ -7,6 +7,7 @@ module.exports = { tsConfig: '/test/tsconfig.spec.json' }, }, + globalSetup: '/test/jest-global-setup.js', collectCoverage: false, collectCoverageFrom: [ 'packages/**/*.ts',