This is a Jest API testing suite for Urban Grocers app. It has tests for GET, POST, PUT and DELETE endpoints. 8/8 tests in this project PASS.
Prepared/executed positive test cases in VS Code for API HTTP request with JavaScript from the Urban Grocers server. Postman was used to pre-test endpoints and git, npm, npx commands were used to run test in the console.
Prerequisite Software Installation: Git, GitHub, Visual Studio, Node.js.,npm, Jest.
- Open the Gitbash console and enter the commands:
cd ~ mkdir projects cd projects
- Clone your Gitbash account with this file hm07-qa-us.
- Open the Gitbash console and enter the commands:
git clone git@github.com:username/hm07-qa-us.git
- From the console project folder, run the command: (install dependencies)
npm install
- To start project testing, configure the server URL link in Visual Studio.
Go to the config.js file Replace the API_URL: "with a newly generated link of the Urban Grocers server"
- To run test, enter into console:
npx jest or to run individual test npx jest {testName.test.js}