Software Development

Laravel Go Testing

Testing apps built with Laravel for Go (the go.laravel.com module, 0.1.x) with go test and laraveltest. Use when writing, reviewing or fixing tests: fakes for the queue, mail, events, notifications, the HTTP client, processes and storage; ActingAs versus real logins and API tokens; authorization; CSRF; validation, redirect, JSON, Inertia and error assertions; database assertions and factories; jobs with client.Attempt, background work, the schedule, ticks; time travel; parallel tests. Each rule shows a test that passes while the app is broken, fails for the wrong reason or is flaky (the sync queue hiding a missing delay, a fake installed after the request, stacked fakes, ActingAs hiding a broken logout or API guard, AssertValid passing on a 500, a followed redirect hiding a 500, lenient JSON and Inertia assertions, a hard-coded ID on SQLite, a second client, AssertSucceeded on a job that did nothing) and the test to write. Every example compiles against go.laravel.com v0.1.0, and the examples were run against a working and a deliberately broken test app (two rules are proved by repeated runs instead). Complements the testing skill a new app ships; for writing app code use laravel-go-best-practices.

Publisher / source
AsyrafHussin/agent-skills (found on skills.sh)
Upstream record
AsyrafHussin/agent-skills
Version
Version 1
Published
Publication review
Approved for publication
Content fingerprint
8d8386b5fe682d9b7b07de54499e1ea565520b26f5a64fcaa75b92d8984c9455