Skip to content

Commit 297436f

Browse files
chore: init unit tests (#3)
* add testing deps: vitest, jsdom, vite-canvas-mock * add session.test.js, run-tests.yml
1 parent 380b10c commit 297436f

File tree

7 files changed

+6175
-675
lines changed

7 files changed

+6175
-675
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### Checklist
22
- [ ] Version number incremented in `package.json`
3+
- [ ] Unit tests are passing
34

45
### Changes
56
<!-- Brief description of changes -->

.github/workflows/run-tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run Jest tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
app:
16+
- dev
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
# setting up node.js
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: '20.x'
30+
31+
- run: npm ci --save-dev
32+
- run: npm test

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ lerna-debug.log*
1717
.vscode/*
1818
!.vscode/extensions.json
1919
.idea
20-
.DS_Store
20+
.DS_Store
21+
22+
# Unit tests
23+
coverage

0 commit comments

Comments
 (0)