Skip to content

Commit 589fff3

Browse files
Merge pull request #42 from kfern/feat-test
feat: Added jest and some tests
2 parents 28ce60c + 2a13b7e commit 589fff3

22 files changed

+6775
-494
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 22 # Use current LTS version
17+
- name: Install dependencies
18+
run: npm install
19+
- name: Run tests
20+
run: npm run test

jest.config.cjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
collectCoverage: true,
5+
coverageDirectory: 'coverage',
6+
coverageReporters: ['text', 'lcov'],
7+
collectCoverageFrom: [
8+
'src/**/*.ts',
9+
'!src/index.ts', // exclude index.ts
10+
],
11+
modulePathIgnorePatterns: ["<rootDir>/docs/"],
12+
moduleNameMapper: {
13+
"^./tools.js$": "<rootDir>/test/helpers/index.ts",
14+
"^./toolsHandler.js$": "<rootDir>/test/helpers/index.ts",
15+
},
16+
};

0 commit comments

Comments
 (0)