Skip to content

Commit

Permalink
chore: upgrade TSTyche (#2291)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas authored Nov 13, 2024
1 parent 3c6b30d commit c8f0dbb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"mockdate": "3.0.5",
"read-pkg": "9.0.1",
"shx": "0.3.4",
"tstyche": "2.1.1",
"tstyche": "3.0.0",
"typescript": "5.6.3",
"vite": "5.4.10",
"vitest": "2.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test('i18n - namespaceTranslation', () => {
`Argument of type '"doe.john"' is not assignable to parameter of type '"doe" | "describe"'`,
)

expect(namespaceTranslation('doe')('john')).type.toEqual<string>()
expect(namespaceTranslation('doe')('john')).type.toBe<string>()

expect(namespaceTranslation('doe')('doesnotexists')).type.toRaiseError(
`Expected 2 arguments, but got 1.`,
Expand All @@ -39,7 +39,7 @@ test('i18n - namespaceTranslation', () => {
namespaceTranslation('doe')('child', {
name: 'Name',
}),
).type.toEqual<string>()
).type.toBe<string>()
expect(
namespaceTranslation('doe')('doesnotexists', {
name: 'Name',
Expand All @@ -60,7 +60,7 @@ test('i18n - namespaceTranslation', () => {
age: '30',
name: 'John',
}),
).type.toEqual<string>()
).type.toBe<string>()

expect(namespaceTranslation('describe')('john', {})).type.toRaiseError()
expect(namespaceTranslation('describe')('john')).type.toRaiseError()
Expand Down
10 changes: 5 additions & 5 deletions packages/use-i18n/src/__typetests__/t.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ const { t } = useI18n<{
}>()

test('i18n - t', () => {
expect(t('hello')).type.toEqual<string>()
expect(t('hello')).type.toBe<string>()
// Single key
expect(t('keydoesnotexists')).type.toRaiseError()

// Multiple keys
expect(t('doe.john')).type.toEqual<string>()
expect(t('doe.john')).type.toBe<string>()
expect(t('doe.doesnotexists')).type.toRaiseError()

// With a param
expect(
t('doe.child', {
name: 'Name',
}),
).type.toEqual<string>()
).type.toBe<string>()
expect(
t('doe.doesnotexists', {
name: 'Name',
Expand All @@ -42,7 +42,7 @@ test('i18n - t', () => {
age: '30',
name: 'John',
}),
).type.toEqual<string>()
).type.toBe<string>()

expect(t('describe.john', {})).type.toRaiseError()
expect(t('describe.john')).type.toRaiseError()
Expand All @@ -56,7 +56,7 @@ test('i18n - t', () => {
</p>
),
}),
).type.toEqual<string>()
).type.toBe<string>()

// Required generic
const { t: t2 } = useI18n()
Expand Down
12 changes: 6 additions & 6 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 c8f0dbb

Please sign in to comment.