https://github.com/zahid-automate/typescript-api-automation
Automation of GET< PUT < POST < DELETE using Jest in TypeScript
https://github.com/zahid-automate/typescript-api-automation
api api-rest jest supertest typescript
Last synced: 4 months ago
JSON representation
Automation of GET< PUT < POST < DELETE using Jest in TypeScript
- Host: GitHub
- URL: https://github.com/zahid-automate/typescript-api-automation
- Owner: Zahid-Automate
- Created: 2024-03-07T21:18:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-29T03:24:24.000Z (over 1 year ago)
- Last Synced: 2024-12-29T08:12:03.397Z (6 months ago)
- Topics: api, api-rest, jest, supertest, typescript
- Language: TypeScript
- Homepage:
- Size: 496 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Setup
Install packages:
npm install --save-dev supertest
npm install --save-dev ts-jest
npm i @types/[email protected] (make sure to match with @types/jest dependency)
npm install --save @types/jest
npm install --save @types/supertest
Package.json file should look like below after all the above commands are run
![]()
Add tsconfig.json file with below details
![]()
Run test
npx jest {filename}Reporting with Jest using Junit
npm install jest-junit --save-dev
==> Include the reporters section in jest.config.js as per below
![]()
Sample junit xml report will look like below
Adding a Jest HTML report
npm install jest-html-reporters --save-dev
==> Include the jest-html-reporters in jest.config.js as per below
![]()
Sample jest HTML report will look like below
