Skip to content

Commit cd2b5a8

Browse files
committed
Set timezone and locale for tests
1 parent 8ef3c37 commit cd2b5a8

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

.vscode/launch.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"runtimeArgs": [
3636
"--inspect=9229"
3737
],
38+
"env": {
39+
"LANG": "en-US"
40+
},
3841
"args": [
3942
"--exit",
4043
"-u",
@@ -43,6 +46,8 @@
4346
"--diff",
4447
"-r",
4548
"ts-node/register",
49+
"-r",
50+
"test/mocha.setup.js",
4651
"test/pure-tests/**/*.ts"
4752
],
4853
"stopOnEntry": false,

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@
11881188
"watch:extension": "tsc --watch",
11891189
"watch:webpack": "gulp watchView",
11901190
"test": "npm-run-all -p test:*",
1191-
"test:unit": "mocha --exit -r ts-node/register test/pure-tests/**/*.ts",
1191+
"test:unit": "LANG=en-US mocha --exit -r ts-node/register -r test/mocha.setup.js test/pure-tests/**/*.ts",
11921192
"test:view": "jest",
11931193
"preintegration": "rm -rf ./out/vscode-tests && gulp",
11941194
"integration": "node ./out/vscode-tests/run-integration-tests.js no-workspace,minimal-workspace",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
process.env.TZ = 'UTC';

extensions/ql-vscode/test/pure-tests/date.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { formatDate } from '../../src/pure/date';
55

66
describe('Date', () => {
77
it('should return a formatted date', () => {
8-
expect(formatDate(new Date(1663326904000))).to.eq('Sep 16, 1:15 PM');
9-
expect(formatDate(new Date(1631783704000))).to.eq('Sep 16, 2021, 11:15 AM');
8+
expect(formatDate(new Date(1663326904000))).to.eq('Sep 16, 11:15 AM');
9+
expect(formatDate(new Date(1631783704000))).to.eq('Sep 16, 2021, 9:15 AM');
1010
});
1111
});

0 commit comments

Comments
 (0)