Skip to content

Commit a27758e

Browse files
committed
test: add test coverage
1 parent 644cfa0 commit a27758e

File tree

10 files changed

+5515
-1920
lines changed

10 files changed

+5515
-1920
lines changed

.eslintrc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
env:
22
node: true
3-
es6: true
3+
jest: true
4+
es2022: true
45

56
globals:
67
Atomics: readonly

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version-file: .node-version
22+
cache: npm
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run tests
28+
run: npm test

jest.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
roots: ['<rootDir>/src'],
5+
testMatch: ['**/__tests__/**/*.test.ts', '**/?(*.)+(spec|test).ts'],
6+
transform: {
7+
'^.+\\.ts$': 'ts-jest'
8+
},
9+
clearMocks: true,
10+
resetMocks: true,
11+
restoreMocks: true,
12+
setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts']
13+
};

0 commit comments

Comments
 (0)