Skip to content

Commit d7505b5

Browse files
ci(test): Added test workflows (#155)
1 parent 75787c0 commit d7505b5

File tree

7 files changed

+4218
-892
lines changed

7 files changed

+4218
-892
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ jobs:
2626
node-version: ${{ matrix.node-version }}
2727
cache: npm
2828

29-
- name: Install & Build
29+
- name: Install, Build, and Test Package
3030
run: |
3131
npm ci
3232
npm i typescript
3333
npm run build
34+
npm run test
35+
36+
- name: Code Coverage
37+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,5 @@ dist
105105

106106
public
107107
public/*
108-
.vercel
108+
.vercel
109+
coverage

jest.config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"preset": "ts-jest",
3+
"testEnvironment": "node",
4+
"testMatch": ["<rootDir>/tests/**/*.test.ts"],
5+
"transform": {
6+
"^.+\\.tsx?$": ["ts-jest", { "tsconfig": "tsconfig.json", "diagnotics": true }]
7+
},
8+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
9+
"testPathIgnorePatterns": ["<rootDir>/node_modules/", "<rootDir>/public/"],
10+
"collectCoverage": true,
11+
"coverageDirectory": "coverage",
12+
"collectCoverageFrom": ["<rootDir>/api/**/*.ts", "<rootDir>/scripts/**/*.ts", "<rootDir>/src/**/*.ts", "<rootDir>/themes/**/*.ts"],
13+
"coverageReporters": ["lcov", "text", "clover", "html"],
14+
"coveragePathIgnorePatterns": ["<rootDir>/node_modules/", "<rootDir>/public/"]
15+
}

0 commit comments

Comments
 (0)