Skip to content

Commit c3a7cbc

Browse files
committed
feat(tests): add base testing
1 parent 6b30b59 commit c3a7cbc

12 files changed

Lines changed: 1610 additions & 104 deletions

File tree

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: test
2+
on:
3+
pull_request:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
unit-tests:
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@v6
12+
with:
13+
submodules: recursive
14+
15+
- name: setup node
16+
uses: actions/setup-node@v6
17+
with:
18+
node-version: latest
19+
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
version: 10.24.0
23+
run_install: false
24+
25+
- name: install Rust stable
26+
uses: dtolnay/rust-toolchain@stable
27+
28+
- name: Rust cache
29+
uses: swatinem/rust-cache@v2
30+
with:
31+
workspaces: '. -> target'
32+
33+
- name: install pnpm deps
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: frontend tests
37+
run: pnpm test:run
38+
39+
- name: rust tests
40+
run: cargo test --manifest-path src-tauri/Cargo.toml

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,7 @@ pnpm tauri build
5959
```
6060

6161
The built application will be in `src-tauri/target/release/bundle/`.
62+
63+
### Disclosure
64+
65+
Due to my essentially zero experience with front end testing, the tests for this project were generated with claude

TODO.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Pepo todo
2+
3+
- [ ] Extract autoscroll math from `src/routes/app/chat/[id]/+page.svelte` into a pure module + tests.
4+
- [ ] Tests for `Emote` conversions in `src-tauri/src/emote/mod.rs` (`from_emote_fragment`, `From<&UserEmote>`, `From<&GlobalEmote>`)
5+
- [ ] HTTP-mocked tests for emote providers (`src-tauri/src/emote/providers/{twitch,bttv,ffz,seventv}.rs`) and OAuth (`src-tauri/src/token.rs`)
6+
- [ ] WebSocket-mocked tests for `src-tauri/src/eventsub.rs`.
7+
- [ ] Tauri command integration tests via `tauri::test::mock_app()`.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
99
"dev": "vite dev",
1010
"preview": "vite preview",
11-
"tauri": "tauri"
11+
"tauri": "tauri",
12+
"test": "vitest",
13+
"test:run": "vitest run"
1214
},
1315
"devDependencies": {
1416
"@eslint/compat": "^2.0.5",
@@ -43,7 +45,9 @@
4345
"typescript": "^6.0.3",
4446
"typescript-eslint": "^8.58.2",
4547
"vaul-svelte": "1.0.0-next.7",
46-
"vite": "^8.0.8"
48+
"vite": "^8.0.8",
49+
"vitest": "^3.2.4",
50+
"jsdom": "^27.0.0"
4751
},
4852
"type": "module",
4953
"dependencies": {

0 commit comments

Comments
 (0)