anatine / zod-plugins

Plugins and utilities for Zod
643 stars 89 forks source link

Deprecated faker functions used in zod-mock #124

Closed cadam11 closed 1 year ago

cadam11 commented 1 year ago

Really liking being able to use Zod schemas to mock objects for testings– thanks for making this library.

I noticed these warnings in the test output:

[@faker-js/faker]: faker.datatype.number() is deprecated since v8.0 and will be removed in v9.0. Please use faker.number.int() instead.
[@faker-js/faker]: faker.name is deprecated since v8.0 and will be removed in v10.0. Please use faker.person instead.
[@faker-js/faker]: faker.datatype.number() is deprecated since v8.0 and will be removed in v9.0. Please use faker.number.int() instead.
[@faker-js/faker]: faker.name is deprecated since v8.0 and will be removed in v10.0. Please use faker.person instead.
[@faker-js/faker]: faker.datatype.number() is deprecated since v8.0 and will be removed in v9.0. Please use faker.number.int() instead.
[@faker-js/faker]: faker.name is deprecated since v8.0 and will be removed in v10.0. Please use faker.person instead.

It might be a good idea to update these as suggested in the warnings. Could always fall back to the legacy function if the new one isn't available to preserve compatibility with older faker.js versions.

ygrenzinger commented 1 year ago

Hello, I have tried to update on my own but I am blocked on one test.

The PR is here : https://github.com/anatine/zod-plugins/pull/125

Brian-McBride commented 1 year ago

Thanks for the work. I took it and ran a step further with it.