Skip to main content

Testing

Test Cases

Jest

Jest for Typescript based unit tests.

Snapshot Testing

Single Test Run

Use test.only function or npm run test -- regex/to/this.test More info found at https://geshan.com.np/blog/2022/07/jest-run-single-test/

Useful Commands

npm run clear-jest

Jest

ab

sudo yum install httpd-tools
ab -n 100 -c 100 -p testquery.json -T "application/json" -H 'x-api-key: foo' https://testsite/

Testing with curl swapping hostnames

curl -v -H "Host:www.foo.com" "http://123.45.67.89/"

curl -v -H "Hostname: www.foo.com" https://123.45.67.89/test

curl -v --connect-to 123.45.67.89:443 https://www.foo.com/test