Skip to content

Commit eb6d403

Browse files
feat: add comprehensive test coverage
This commit introduces a testing framework and adds comprehensive unit tests to the project, significantly improving test coverage. Key improvements: - **Testing Framework**: Set up `vitest` and `happy-dom` for unit testing within the Vite environment. - **Component Tests**: - `map.ts`: Added tests for computed signals that transform note data into GeoJSON. - `list.ts`: Added tests for note rendering, including distance/time calculations and IntersectionObserver logic. - `form.ts`: Added tests for form submission, mocking geolocation and database interactions. - **CI/CD**: Introduced a GitHub Actions workflow to run tests automatically on push and pull requests, ensuring code quality and preventing regressions. All new tests pass and cover critical application logic and edge cases.
1 parent bd4d40e commit eb6d403

7 files changed

Lines changed: 724 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Run Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Use Node.js
11+
uses: actions/setup-node@v3
12+
with:
13+
node-version: '20'
14+
- name: Install dependencies
15+
run: npm ci
16+
- name: Run tests
17+
run: npm test

0 commit comments

Comments
 (0)