- bat: like curl, but with a nicer output
- apt-get install httpie # https://httpie.org
curl http://localhost:4444/todos -X POST \
-H "Content-Type: application/json" \
-d '{"task": "do bad thing"}'
http -f POST http://localhost:4444/todos done=false
curl http://localhost:4444/todos -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"task": "learn how to auth"}'
http POST http://localhost:4444/todos "Authorization:Bearer $TOKEN" task="learn how to auth"
cd ./api/postgrest/
./manage/dev/full_db_setup [redo]
ng test
cypress open
ng test --browsers ChromeHeadless
cypress run
ng test --browsers ChromeHeadless --watch=false && cypress run
-
ng add @briebug/cypress-schematic --addCypressTestScripts
-
Update .gitignore
# Cypress /cypress/videos/ /cypress/screenshots/
-
Run one of those:
- ng e2e [--headless] OR npm e2e
- npm cy:open
- npm cy:run
-
Setup CI like (for now) oneliner (will need to serve production build later)
- npm install --save-dev start-server-and-test
- update package.json
"e2e:ci": "start-server-and-test start http://ng.reminders.test:4200 cy:run",
- npm run e2e:ci
https://codecraft.tv/courses/angular/unit-testing/asynchronous/ https://angular.io/guide/testing-services