Testing

Cypress

Mocking

Playwright

Test-Driven Development

  • 📺 TDD for those who don't need it - GopherCon SG 2017 • 14 minute video by Chew Choon Keat humourously converting you to TDD by showing how you can use it to loop through a declarative list of requirements you list up front
  • 📺 TDD, Where Did It All Go Wrong? • 64 minute video by Ian Cooper about how to apply TDD as originally intended and avoid bad testing practices like testing implementation details rather than required behaviours
  • 📺 TDD: The Bad Parts • 30 minute video by Matt Parker about bad testing practices to avoid. Includes great tip to pair tests with each behaviour, not each file

Vitest

  • Notes on Fast Unit Testing With Vitest:
    • ESM is async by default, while CommonJS is sync by default
      • When you require a CJS module, you can't be sure that it's ready to use
      • This makes it hard to use Jest (which uses CJS) with Vite (which uses ESM)

Bookmarks

  • 📺 Fast Unit Testing With Vitest • Feb 3, 2023 • Anthony Fu & Jason Lengstorf explain the differences between Vitest and Jest, then demonstrate how to install and configure Vitest and use it to write unit tests (including snapshot tests)