I don't write unit tests much anymore


I don't write unit tests much anymore.

GitHub Copilot writes them for me. 🔥

Here's how:
1. Create a well-named function.
2. Create a test file.
3. Let Copilot create the tests.
4. Any missing? Name the test. Then Copilot writes it.

Huge time-saver. 👍

The blog post outlines this workflow:

https://www.strictmode.io/articles/using-github-copilot-for-testing
Some people said it doesn’t work for them in complex situations.

I’ve found Copilot works well for writing unit tests when:

- I’m testing a pure function
- The function is well-named
- I name the test clearly

It typically figures out the rest.

View original on X