Controller Software for the Brother PP-1 SKiTCH embroidery machine.
Find a file
Jan-Henrik Bruhn 584f795330 feature: Add comprehensive tests for PEN encoding logic
- Extract PEN encoding logic into separate testable module (penEncoder.ts)
- Implement 24 comprehensive tests covering:
  - Position encoding and coordinate shifting
  - Lock stitch direction calculation (forward/backward)
  - Lock stitch generation with rotation
  - Full PEN encoding with color changes, jumps, and bounds
  - Edge cases (empty arrays, single stitches, TRIM flags)

- Setup vitest for testing
- Refactor pattern converter worker to use extracted penEncoder module
- Fix bounds calculation to include non-MOVE stitches (not just STITCH)
- Remove duplicate function definitions from worker
- Add test scripts: npm run test, npm run test:ui, npm run test:run

All tests passing (24/24) and build successful.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 11:44:48 +01:00
.claude Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
.github feature: Streamline build pipeline to only run lint and build checks 2025-12-13 14:15:07 +01:00
build Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
docs Improve responsive design and simplify typography system 2025-12-10 16:56:43 +01:00
electron feature: Implement Web Worker-based pattern conversion with progress tracking 2025-12-13 13:34:13 +01:00
public Icons 2025-12-08 00:21:31 +01:00
src feature: Add comprehensive tests for PEN encoding logic 2025-12-14 11:44:48 +01:00
.gitignore Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
.node-version feature: use proper node version for used electron version 2025-12-12 20:58:48 +01:00
CLAUDE.md feature: Add autolabeler configuration and commit guidelines 2025-12-12 20:31:44 +01:00
eslint.config.mjs feature: Implement Zustand state management 2025-12-12 21:28:52 +01:00
forge.config.js Fix auto-update structure and macOS manifest URL 2025-12-11 13:22:38 +01:00
index.html Icons 2025-12-08 00:21:31 +01:00
LICENSE.md add license 2025-12-07 22:58:02 +01:00
package-lock.json feature: Add comprehensive tests for PEN encoding logic 2025-12-14 11:44:48 +01:00
package.json feature: Add comprehensive tests for PEN encoding logic 2025-12-14 11:44:48 +01:00
tailwind.config.js Implement comprehensive dark mode support and improve pattern visibility 2025-12-06 20:12:46 +01:00
tsconfig.app.json Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
tsconfig.electron.json Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
tsconfig.json initial 2025-11-30 22:18:14 +01:00
tsconfig.node.json Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
vite.config.electron.mts Add Electron desktop application support with Electron Forge 2025-12-07 22:39:38 +01:00
vite.config.mts feature: Add application version to page title 2025-12-13 23:48:05 +01:00
vitest.config.ts feature: Add comprehensive tests for PEN encoding logic 2025-12-14 11:44:48 +01:00