John Williams
06/06/2022, 12:21 PMconst opts = {
...
stateHandlers: {
[null]: () => {
// This is the "default" state handler, when no state is given
}
"Has no animals": () => {
animalRepository.clear()
return Promise.resolve(`Animals removed from the db`)
},
"Has some animals": () => {
importData()
return Promise.resolve(`Animals added to the db`)
},
"Has an animal with ID 1": () => {
importData()
return Promise.resolve(`Animals added to the db`)
}
}
}
return new Verifier(opts).verifyProvider().then(...)
so like in the above example. If the consumer is expecting in the request it sends an id, and name and expects the id to be 1. Can i just hardcode the data as something like this:
{
"id": 1,
"name": "dog"
}
Boris
06/07/2022, 12:38 AMBoris
06/07/2022, 12:38 AMBoris
06/07/2022, 12:39 AMBoris
06/07/2022, 12:41 AMBoris
06/07/2022, 12:41 AMJohn Williams
06/08/2022, 11:57 AMBoris
06/09/2022, 11:04 AM