-
Notifications
You must be signed in to change notification settings - Fork 6
[DIT-12085] Add tests for JSONFormatter and account for pluralForm #134
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
[DIT-12085] Add tests for JSONFormatter and account for pluralForm #134
Conversation
… items and components.
… correct developer ID key in json formatter tests
marla-hoggard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a couple nits.
This relies on changes from the API which are also still open in a PR, so we'll need to wait for that one to deploy before publishing this to NPM. We could merge this without publishing, but probably safest to wait and do it all at once.
lib/src/http/components.test.ts
Outdated
| const mockResponse = { | ||
| data: [ | ||
| { | ||
| id: "text1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| id: "text1", | |
| id: "text1_one", |
lib/src/http/types.ts
Outdated
|
|
||
| export const ZTextPluralType = z | ||
| .enum(["zero", "one", "two", "few", "many", "other"]) | ||
| .nullable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Can we remove nullable() from here so that ZTextPluralType is enum, and instead apply nullable() on line 38? That's consistent with the typing in the main app.
…idual plural type
Overview
JSONFormatterclassContext
DIT-12085: CLI: Update default JSON formatter to write plurals to JSON files
Test Plan
Setup
🚨 Make sure you're working off of the backend branch with the relevant API changes
Have a basic config set up, e.g.
yarn syncat the root of the CLI directory, this should pull from your local Ditto environmentmy-developer-id_manymy-developer-id_many