Skip to content

Commit

Permalink
fix: update datetime tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Jul 13, 2023
1 parent 07a840b commit d472029
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 62 deletions.
5 changes: 1 addition & 4 deletions e2e/datetime.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ import { getText } from './helper'
await page.selectOption('#app select', 'en-US')
const text = await getText(page, 'p')
expect(text).include('Current Datetime')
// TOOD:
// skip this assertions because of the timezone issue
// https://github.com/nodejs/node/issues/46123
expect(text).toMatch(
/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])\/([12]\d{3}), (0[0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (AM|PM)/
/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])\/([12]\d{3}), (0[0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9])/
)
})
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"globby": "^13.1.4",
"jiti": "^1.18.2",
"js-yaml": "^4.1.0",
"jsdom": "^21.1.2",
"jsdom": "^22.1.0",
"lint-staged": "^12.0.0",
"listhen": "^1.0.4",
"minimist": "^1.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test('basic usage', async () => {
/([1-9]|1[0-2])\/([1-9]|[12]\d|3[01])\/([12]\d{3})/
)
expect(wrapper.html()).toMatch(
/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])\/([12]\d{3}), (0[0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (AM|PM)/
/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])\/([12]\d{3}), (0[0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9])/
)
expect(wrapper.html()).toMatch(
/令和([1-9]|1[0-2])年([1-9]|1[0-2])月([1-9]|[1-3][0-9])日(月|火|水|木|金|土|日)曜日 (午前|午後)([0-9]|1[0-2]):([0-5][0-9]):([0-5][0-9]) (協定世界時|グリニッジ標準時)/
Expand Down
23 changes: 12 additions & 11 deletions packages/vue-i18n-core/test/composer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,7 @@ describe('__datetimeParts', () => {
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
dayPeriod: 'short',
timeZone: 'America/New_York'
}
}
Expand All @@ -1765,17 +1766,17 @@ describe('__datetimeParts', () => {
part: true
})
).toMatchObject([
{ value: '12' },
{ value: '/' },
{ value: '19' },
{ value: '/' },
{ value: '2012' },
{ value: ', ' },
{ value: '10' },
{ value: ':' },
{ value: '00' },
{ value: ' ' },
{ value: 'PM' }
{ value: '12', type: 'month' },
{ value: '/', type: 'literal' },
{ value: '19', type: 'day' },
{ value: '/', type: 'literal' },
{ value: '2012', type: 'year' },
{ value: ', ', type: 'literal' },
{ value: '10', type: 'hour' },
{ value: ':', type: 'literal' },
{ value: '00', type: 'minute' },
{ value: ' ', type: 'literal' },
{ value: 'at night', type: 'dayPeriod' }
])
})

Expand Down
67 changes: 22 additions & 45 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d472029

Please sign in to comment.