~/talk

MySQL, Node & Testcontainers Testing Done Right

Talkat Connect.Tech 2024 · 2024-11-18..11-20· [nodejs, testing]
links:none on file
slides:none on file

Shows using Testcontainers to spin a throwaway MySQL Docker instance with one line (new MySQLContainer().start()), the Node built-in test runner to run suites, and the MySQL X DevAPI + Faker to insert and verify data; demo creates a user table via a DDL script, runs two tests (container check and create-user) that take ~69ms and ~23ms, and cleanly shuts the container down. Emphasizes isolated test database per suite, avoid hard‑coded values, and using a separate data‑utils SQL check rather than the production repository code.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:12Why testing matters
  3. 4:04Unit vs integration tests
  4. 7:15Challenges of testing with databases
  5. 10:06Introducing Testcontainers
  6. 12:33Node test runner overview
  7. 17:29Demo setup with Testcontainers
  8. 23:31Code walkthrough: user repository
  9. 27:04Code walkthrough: data utils
  10. 32:26Best practices for testing
  11. 39:34Resources and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.