diff --git a/.vscode/launch.json b/.vscode/launch.json index b461c8da2..1d1b45292 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -35,6 +35,9 @@ "runtimeArgs": [ "--inspect=9229" ], + "env": { + "LANG": "en-US" + }, "args": [ "--exit", "-u", @@ -43,6 +46,8 @@ "--diff", "-r", "ts-node/register", + "-r", + "test/mocha.setup.js", "test/pure-tests/**/*.ts" ], "stopOnEntry": false, diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index 226a7e1ac..6f1fb1c5c 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -1188,7 +1188,7 @@ "watch:extension": "tsc --watch", "watch:webpack": "gulp watchView", "test": "npm-run-all -p test:*", - "test:unit": "mocha --exit -r ts-node/register test/pure-tests/**/*.ts", + "test:unit": "LANG=en-US mocha --exit -r ts-node/register -r test/mocha.setup.js test/pure-tests/**/*.ts", "test:view": "jest", "preintegration": "rm -rf ./out/vscode-tests && gulp", "integration": "node ./out/vscode-tests/run-integration-tests.js no-workspace,minimal-workspace", diff --git a/extensions/ql-vscode/test/mocha.setup.js b/extensions/ql-vscode/test/mocha.setup.js new file mode 100644 index 000000000..ec4b15613 --- /dev/null +++ b/extensions/ql-vscode/test/mocha.setup.js @@ -0,0 +1 @@ +process.env.TZ = 'UTC'; diff --git a/extensions/ql-vscode/test/pure-tests/date.test.ts b/extensions/ql-vscode/test/pure-tests/date.test.ts index 2d00f2536..9dccbb500 100644 --- a/extensions/ql-vscode/test/pure-tests/date.test.ts +++ b/extensions/ql-vscode/test/pure-tests/date.test.ts @@ -5,7 +5,7 @@ import { formatDate } from '../../src/pure/date'; describe('Date', () => { it('should return a formatted date', () => { - expect(formatDate(new Date(1663326904000))).to.eq('Sep 16, 1:15 PM'); - expect(formatDate(new Date(1631783704000))).to.eq('Sep 16, 2021, 11:15 AM'); + expect(formatDate(new Date(1663326904000))).to.eq('Sep 16, 11:15 AM'); + expect(formatDate(new Date(1631783704000))).to.eq('Sep 16, 2021, 9:15 AM'); }); });