Test coverage gaps: PPU, APU, controllers, mappers, browser, state serialization
- Dominant language
- JavaScript
- Stars
- 6.4k
- Forks
- 857
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Current test coverage is limited to:
- CPU instructions (`cpu.spec.js`)
- Basic NES initialization and ROM loading (`nes.spec.js`)
- Mapper 0 basics (`mappers.spec.js`)
- nestest and AccuracyCoin ROM harnesses
Missing test files for:
- **PPU**: register behavior, VRAM mirroring, sprite evaluation, scrolling, palette
- **APU**: channel behavior, frame counter, mixer, sweep unit
- **Controllers**: turbo button logic, clock(), strobe protocol
- **ROM parser**: trainer ROMs, truncated data, NES 2.0 headers
- **Mappers 1-241**: MMC1, MMC3, MMC5, etc. have zero unit tests
- **State serialization**: no round-trip toJSON()/fromJSON() tests
- **Browser layer**: Screen, Speakers, KeyboardController, GamepadController
- **GameGenie**: decode/encode round-trip, invalid input handling
The highest-value additions would be:
1. MMC3 IRQ counter unit tests (most complex and bug-prone mapper code)
2. PPU register behavior tests
3. State serialization round-trip tests
4. APU sweep unit tests
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.