Skip to main content

Testing

Test Cases

Behavior Driven Development

  • Cucumber is a tool that supports Behaviour-Driven Development (BDD). As a story writer you can write some plain-language structured definitions and then associate them with individual assertion functions. It makes sense if you read the 10-minute tutorial for Cucumber.

Jest

Jest for Typescript based unit tests.

Safetest

  • kolodny/safetest is a powerful UI testing library that combines Playwright, Jest/Vitest, and React for a powerful end-to-end testing solution for applications and component testing

Async and Jest

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