jermbo / SampleAPIs

A simple, no fuss, no mess, no auth playground for learning RESTful or GraphQL APIs.
https://sampleapis.com/
MIT License
214 stars 55 forks source link

Add initial tests for apiList.js #94

Closed thevueguy closed 4 years ago

thevueguy commented 4 years ago

Initial implementation of #91

Added tests using Jest for the following:

✅ Ensure all .json files in the api folder have id's associated with each entry point. ✅ Ensure all .json files in the api folder have at least 1 endpoint. ❌ Ensure all endpoints are included in the apiList.js file ✅ Ensure all endpoints included have the minimum values. ✅ Ensure all .json files in the api folder have associated backup file. .json.backup ❌ Ensure all endpoints are rendering. ❌ Ensure CRUD works on each endpoints. ✅ apiList.js entry should have the following information:

{ id: 0, // Unique ID title: "", // Title to be displayed on home and individual pages longDesc: "", // A long description meant for display on the individual page. desc: "", // A short description meant for display on the home page link: "", // Link to be used in the url. This should match the json file name exactly. graphLink: "", // The same name as the link, but with a '/graphql' in at the end.
endPoints: [ "" , ... ], // list of available endpoints, in string format. }

To test just run npm install and npm run test. Tests are located in the /src/tests folder but can be relocated wherever needed.