-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts-jest
support
#1272
Comments
I started to use a mock for jest, unfortunately, this is what I did and it is not ready yet: export const t = (text: string | Array<string>) => {
if (typeof text === text) {
return text.trim()
} else if (text instanceof Array) {
return text.map((t) => t.trim()).join(' ')
}
return text
}
type Plural = {
value: number
one: string
other: string
}
export const plural = (count: number | Plural, plural: Plural) => {
if (isNaN(count as number)) {
plural = count as Plural
if (plural.value <= 1) {
return plural.one.replace('#', `${plural.value}`)
}
return plural.other.replace('#', `${plural.value}`)
}
if (count <= 1) {
return plural.one.replace('#', `${count}`)
}
return plural.other.replace('#', `${count}`)
} If guys want to help get further :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
1 similar comment
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@andrii-bodnar @kopax-polyconseil supporting also typescript transformation in additional to SWC and babel plugin has no sense as it means complete rewrite the whole macro as typescrit transformation and supporting all 3 versions. Where typescript transformations has no advantages over SWC or babel. @kopax-polyconseil if you want to speedup your test it's better to try SWC, as it's dozen times faster than typescript and babel. Lingui plugin for SWC is almost ready. #1224 |
Is your feature request related to a problem? Please describe.
We use lingui since a while and despite it's cool to use, our app now gets bigger and the amount of unit tests too. For this reason, we wanted to switch to
ts-jest
instead ofbabel-jest
to improve our tests perfs, but it is not possible as lingui does not supportts-jest
.With
ts-jest
, we got this error everywhere:Describe proposed solution
Support for
ts-jest
Describe alternatives you've considered
Removing lingui as we don't really need translation.
Additional context
The text was updated successfully, but these errors were encountered: