-
Notifications
You must be signed in to change notification settings - Fork 2
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
New test data models documentation #687
Conversation
|
|
||
## Context | ||
|
||
First of all, remember that a test data model is a set of objects that allows to create objects that mimic commercetools APIs responses which help during testing implementation. |
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.
First of all, remember that a test data model is a set of objects that allows to create objects that mimic commercetools APIs responses which help during testing implementation. | |
First of all, remember that a test data model is a set of objects that allow consumers to create objects that mimic commercetools APIs responses which help during testing implementation. |
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.
Update here: 1f27b84
}; | ||
``` | ||
|
||
In this example, `name` and `description` are values that are calculated based on the `nameAllLocales` and `descriptionAllLocales`. The latter need to be built first using the `postBuild` function. |
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.
In this example, `name` and `description` are values that are calculated based on the `nameAllLocales` and `descriptionAllLocales`. The latter need to be built first using the `postBuild` function. | |
In this example, `name` and `description` are values that are calculated based on the `nameAllLocales` and `descriptionAllLocales`. The latter need to be built first, then `name` and `description` are built using the `postBuild` function. |
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.
Hopefully I have the order correct here.
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.
Updated here: fdafc20
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.
A few nits that honestly you can take or leave! I adore the CLI for generating new models. New contributors will have a much lower hurdle.
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.
Only one paragraph that I suggested a few grammatical fixes for, but nothing blocking merging.
This is an optional and we should only use if there are any dependencies among the data model fields. | ||
In this case, `name` and `description` depend on the values from `nameAllLocales` and `descriptionAllLocales` but we don't know them in advance but only once the data model has been built. The `postBuild` callback allows to manipulate the built object before it's returned to the consumer. |
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: Small grammatical cleanup.
This is an optional and we should only use if there are any dependencies among the data model fields. | |
In this case, `name` and `description` depend on the values from `nameAllLocales` and `descriptionAllLocales` but we don't know them in advance but only once the data model has been built. The `postBuild` callback allows to manipulate the built object before it's returned to the consumer. | |
This is optional and we should only use it if there are any dependencies among the data model fields. | |
In this case, `name` and `description` depend on the values from `nameAllLocales` and `descriptionAllLocales`. We won't know the values in advance, but will once the data model has been built. The `postBuild` callback allows us to manipulate the built object before it's returned to the consumer. |
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.
Thanks for the suggestion, Sarah 🙇
Applied here: 783806a
This PRs add new documentation to the repository where we explain how new test data models look like and how to build them.