git clone https://github.com/sadabnepal/pactum-api-test.git
cd pactum-api-test
export ENV=local
OR
export ENV=dev
npm run test
The project is using pactum mock which provides following endpoints
GET: /api/users/{id}
fetches the user information by user id
POST: /api/users
fetches the user with query parameter { page: 2 }
POST: /api/users
creates user with body { name: 'Ken', job: 'Test Engineer' }
GET: /bearer
authenticate user with token that includes Bearer
pactum: https://pactumjs.github.io/introduction/welcome.html
supertest: http://visionmedia.github
mocha: https://ricostacruz.com/mocha/
mocha config: https://github.com/mochajs/mocha/tree/master/example/config
eslint: https://eslint.org/docs/latest/use/getting-started
vscode settings: https://code.visualstudio.com/docs/getstarted/settings
Blog: https://medium.com/@joaovitorcoelho10/pactumjs-a-next-gen-rest-api-testing-tool-ae88a9e51916
- better reusable http calls