| 1 | import { describe, expect, it } from "bun:test"; |
| 2 | |
| 3 | import { createBug, MAX_BUGS |
| 4 | |
| 5 | describe("bug invasion limits", () |
| 6 | it("caps the swarm at a positive number of bugs", |
| 7 | expect(MAX_BUGS).toBeGreaterThan |
| 8 | expect(Number.isInteger |
| 9 | }); |
| 10 | }); |
| 11 | |
| 12 | describe("createBug", () |
| 13 | it("keeps the bug on-screen with a tilt in range", |
| 14 | const bug = |
| 15 | expect(bug).toEqual |
| 16 | }); |
| 17 | |
| 18 | it("stays within the viewport at the extremes", |
| 19 | const low = |
| 20 | expect(low.x |
| 21 | expect(low.y |
| 22 | expect(low.angle |
| 23 | |
| 24 | const high = |
| 25 | expect(high.x |
| 26 | expect(high.y |
| 27 | expect(high.angle |
| 28 | }); |
| 29 | }); |