Set timezone and locale for tests
This commit is contained in:
Родитель
8ef3c3713b
Коммит
cd2b5a8c59
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
process.env.TZ = 'UTC';
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче