Skip to content

Commit ffbe15c

Browse files
a6b8claude
andcommitted
Add Jest tests and GitHub Actions workflow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d8df14c commit ffbe15c

6 files changed

Lines changed: 4822 additions & 4 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run Tests on Release
2+
on: push
3+
permissions:
4+
contents: read
5+
id-token: write
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
- name: Use Node.js
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: 22
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Run Jest tests (with coverage)
19+
run: npm run test:coverage:src
20+
- name: Upload coverage to Codecov (OIDC)
21+
uses: codecov/codecov-action@v5
22+
with:
23+
use_oidc: true
24+
files: ./coverage/lcov.info
25+
fail_ci_if_error: true
26+
flags: unittests

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dataTest
22
node_modules
3-
tests/data/
3+
tests/data/
4+
coverage/

jest.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
testEnvironment: 'node',
3+
testMatch: ['**/tests/jest/**/*.test.mjs'],
4+
collectCoverageFrom: ['src/**/*.mjs', '!src/**/*.test.mjs'],
5+
coverageThreshold: {
6+
global: { branches: 50, functions: 50, lines: 50, statements: 50 }
7+
},
8+
coverageDirectory: 'coverage',
9+
coverageReporters: ['text', 'lcov', 'html', 'json'],
10+
verbose: true,
11+
testTimeout: 10000
12+
}

0 commit comments

Comments
 (0)