🧹 Cleaning up after your integration test?

by Remy van Duijkeren | Jun 21, 2023 | Shorts

🧹 Cleaning up after your integration test?

🛑 Stop doing that!

When you do an integration test, you often need to create a record in the database.

These tests are often wrapped in a try..finally statement, where the just created record is being cleaned up in the finally section.

❌ Don't clean-up after te test.

✅ Do clean-up before you do the test!

Benefits:

✔️ Really start with a clean state, even when you are debugging your test and stop half-way.

✔️ Get rid of the try...finally statement around your test.

✔️ When the test fails, you can still review the created record for problems. It's still there!

Related

Hourly billing kills love.

Hourly billing kills love. I saw it happen again and again at implementation partners. Everything starts fun… and then it slowly burns down. Year 1:...

Read More