Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zahid-automate/typescript-api-automation


https://github.com/zahid-automate/typescript-api-automation

Last synced: 7 days ago
JSON representation

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



image

Add tsconfig.json file with below details


image

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



image

Sample junit xml report will look like below

image

Adding a Jest HTML report

npm install jest-html-reporters --save-dev

==> Include the jest-html-reporters in jest.config.js as per below

image

Sample jest HTML report will look like below

![_C__Users_mzahi_Desktop_TypeScript-API-Automation_reports_jest_html_reporters html(iPad Pro)](https://github.com/Zahid-Automate/TypeScript-API-Automation/assets/45691238/e06fe1b1-86e2-42d2-babd-79650180437d)