Skip to content

TESTS.md — how I checked that this works ​

Copy this template

To start your own TESTS.md, open Show the text to copy below and use the copy button at the top right of the block, then paste it into a new file called TESTS.md in your repository. On GitHub, use the Copy raw file button on the template's GitHub page.

Show the text to copy
md
# TESTS.md — how I checked that this works

> Manual tests are steps a person follows. Automated tests are code that checks code (`npm test`).
> Every acceptance criterion in `SPEC.md` should have at least one test here. Include edge cases.
> **Check first:** write each test before you ask for the code it checks, in a separate step. If an AI writes the test, ask for the test alone, in its own prompt, so it isn't shaped by the code it is meant to check.

## Manual tests

Run these in a fresh browser tab. For the "reload" tests, reload the page before checking.

| ID | Checks | Steps | Expected result | Result (date) |
|---|---|---|---|---|
| T1 | AC1 | 1. Type "Read" in the box. 2. Press Enter. | "Read" appears at the bottom of the list; the box is empty. | ☐ |
| T2 | AC2 (edge case) | 1. Leave the box empty. 2. Press Enter. | Nothing is added; the message "Please type a name" appears. | ☐ |
| T3 | AC3 (edge case) | 1. Add two items. 2. Reload the page. | Both items are still there, in the same order. | ☐ |
| T4 | | | | ☐ |

### Edge cases I considered

- [ ] Empty input
- [ ] Very long input (paste 500 characters)
- [ ] Duplicate entries
- [ ] Special characters and emoji (`<b>hi</b>`, `"quotes"`, 🎉)
- [ ] Reloading the page / closing and reopening the browser
- [ ] Small phone screen
- [ ] Slow or no internet (for apps that call an API)

## Automated tests

Run with:

```bash
npm test
```

| Test file | What it checks |
|---|---|
| `tests/[name].test.js` | |

## Bugs found by testing

| Date | Bug | How I found it | Fixed in commit |
|---|---|---|---|
| | | | |

Manual tests are steps a person follows. Automated tests are code that checks code (npm test). Every acceptance criterion in SPEC.md should have at least one test here. Include edge cases. Check first: write each test before you ask for the code it checks, in a separate step. If an AI writes the test, ask for the test alone, in its own prompt, so it isn't shaped by the code it is meant to check.

Manual tests ​

Run these in a fresh browser tab. For the "reload" tests, reload the page before checking.

IDChecksStepsExpected resultResult (date)
T1AC11. Type "Read" in the box. 2. Press Enter."Read" appears at the bottom of the list; the box is empty.☐
T2AC2 (edge case)1. Leave the box empty. 2. Press Enter.Nothing is added; the message "Please type a name" appears.☐
T3AC3 (edge case)1. Add two items. 2. Reload the page.Both items are still there, in the same order.☐
T4☐

Edge cases I considered ​

  • ☐ Empty input
  • ☐ Very long input (paste 500 characters)
  • ☐ Duplicate entries
  • ☐ Special characters and emoji (<b>hi</b>, "quotes", 🎉)
  • ☐ Reloading the page / closing and reopening the browser
  • ☐ Small phone screen
  • ☐ Slow or no internet (for apps that call an API)

Automated tests ​

Run with:

bash
npm test
Test fileWhat it checks
tests/[name].test.js

Bugs found by testing ​

DateBugHow I found itFixed in commit

Materials CC BY 4.0 · Code MIT