Skip to content

Commit d399f88

Browse files
committed
chore: add jest
1 parent 46baa24 commit d399f88

File tree

9 files changed

+6742
-3501
lines changed

9 files changed

+6742
-3501
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
- name: Install dependencies
2323
run: npm ci
2424

25-
# - name: Run tests
26-
# run: npm test
25+
- name: Run tests
26+
run: npm test
2727

2828
- name: Upload results to Codecov
2929
uses: codecov/codecov-action@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/node_modules
2+
/coverage
23
/bin

jest.config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { JestConfigWithTsJest } from "ts-jest";
2+
3+
const jestConfig: JestConfigWithTsJest = {
4+
preset: "ts-jest",
5+
moduleDirectories: ["node_modules", "<rootDir>"],
6+
modulePathIgnorePatterns: [
7+
"<rootDir>/.next",
8+
"<rootDir>/dist",
9+
],
10+
moduleNameMapper: {
11+
"^~/(.*)$": "<rootDir>/src/$1",
12+
},
13+
transform: {
14+
"^.+\\.[tj]s$": ["ts-jest", {
15+
tsconfig: {
16+
allowJs: true,
17+
},
18+
}],
19+
},
20+
transformIgnorePatterns: [
21+
"<rootDir>/node_modules/(?!change-case)",
22+
],
23+
collectCoverage: true,
24+
};
25+
26+
export default jestConfig;

0 commit comments

Comments
 (0)