RIAEvangelist / node-dominos-pizza-api

This is a node.js wrapper for the dominos pizza apis
MIT License
514 stars 126 forks source link

Need Docs On Testing #113

Closed alestor123 closed 3 years ago

alestor123 commented 3 years ago

I think we need to find a way to test this api without costing or ordering some thing it would be a huge pain to develop with this api @RIAEvangelist

RIAEvangelist commented 3 years ago

Please see the tests. We already do this.

alestor123 commented 3 years ago

@RIAEvangelist other than calling the api every time

RIAEvangelist commented 3 years ago

The only thing you do not want to do is actually pay for the pizza. All the rest of the calls, you do want to really hit the API and validate the real responses. Stubbing the responses would lead to major testing problems if dominos made any endpoint changes.

If you wanted to create your own stubbing service, you could just add that to the URLS object as described in the internationalization docs. This might be worth documenting as well. Like a test Stubbing doc to give an example to testers.

RIAEvangelist commented 3 years ago

The base example is here docs/InternationalSupport.md

it could easily be used to make a stubbing service too.

RIAEvangelist commented 3 years ago

But one of the main reasons this could be bad is if dominos does some checks, like if a store is open etc. the subbed response might not consider that and give false passing.