Welcome to copilot-test β a repository where tests go to be written, ignored, and eventually blamed for everything.
- Denial β "It passed on my machine."
- Anger β "WHO CHANGED THIS?!
git blame... oh. It was me." - Bargaining β "What if I just skip this test for now? Just temporarily. For like 3 years."
- Depression β
npm testoutput: 247 passing, 1 failing. The 1 is always the one you care about. - Acceptance β You add
// TODO: fix thisand open a PR.
"The best tests are the ones that catch bugs you didn't know you had, written at 2am, that you'll spend the next morning wondering why they exist."
- Unit tests: Tests that prove your function works perfectly in a vacuum that bears no resemblance to production.
- Integration tests: Tests that prove two things work together β until the third thing shows up.
- End-to-end tests: Tests that fail randomly and everyone agrees are "flaky" rather than fixing them.
- Manual testing: Clicking around and hoping for the best. A classic.
// The Classic
test('it works', () => {
expect(true).toBe(true);
});
// The Optimist
test('nothing will ever go wrong', () => {
// TODO: write actual test
});
// The Philosopher
test('what even is a bug, really', () => {
expect(undefined).toBeDefined(); // spoiler: it fails
});| File | Coverage |
|---|---|
the-important-one.js |
12% |
utils.js |
98% |
todo.js |
0% |
definitely-not-broken.js |
"trust me" |
Coverage: 37% β the badge is red but our hearts are green. π
npm test
# output: "found 0 vulnerabilities" (this is a lie)Good luck. You'll need it.