-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Update to @faker-js/faker
6.3.1 or later
#30143
Comments
After attempting an upgrade to @faker-js/faker@6.3.1 the following test fails:
The code is here: cypress/packages/frontend-shared/script/testStubSpecs.ts Lines 136 to 141 in b2a694f
Unfortunately I don't have the coding skills to know how to fix this. I'm just sharing what I discovered in my failed attempt to upgrade. |
@MikeMcC399 type NameTemplate = {
readonly [key: string]: TemplateExecutor
} Then pass it as the generic arguments to {
// ...
// this will tell TS the return type of "objectElement" is a TemplateExecutor
// which is what's expected.
template: faker.random.objectElement<NameTemplate, keyof NameTemplate>(nameTemplates)
} Alternatively you could use the objectValue method from the {
// ...
template: faker.helpers.objectValue<NameTemplate>(nameTemplates),
} This should make typescript happy. run the |
Many thanks for your solution suggestions! Please feel free to submit a PR to resolve this issue. My goal was to prepare as much as I could for the list of deprecated dependencies, not to necessarily resolve all of them myself. You have better skills than I do for this issue, so it would make sense for you to take the lead. |
What would you like?
Why is this needed?
The repo https://github.com/Marak/Faker.js sourcing the npm module @types/faker was deleted and the module is de-facto now unsupported (see https://fakerjs.dev/about/announcements/2022-01-14.html#i-heard-something-happened-what-s-the-tldr).
As described in Migrating from Faker v5 to v6 in the TypeScript section
Other
Where used:
"@faker-js/faker": "5.5.3"
"@types/faker": "5.5.8"
"@faker-js/faker": "5.5.3"
"@types/faker": "5.5.8"
latest
is currently8.4.1
Related PR
The text was updated successfully, but these errors were encountered: