Skip to content

Commit 7e095e4

Browse files
committed
ci: test ci 추가
1 parent 62bbe85 commit 7e095e4

File tree

5 files changed

+182
-5
lines changed

5 files changed

+182
-5
lines changed

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
pull-requests: write
13+
checks: write
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Setup Node.js 20.x
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 20.x
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v2
25+
with:
26+
version: 9
27+
28+
- name: Install Dependencies
29+
run: pnpm install --frozen-lockfile
30+
31+
- name: Run tests with coverage
32+
run: pnpm --filter notion-to-utils test -- --coverage
33+
34+
# - name: Report Coverage
35+
# uses: davelosert/vitest-coverage-report-action@v2
36+
# with:
37+
# working-directory: packages/notion-to-utils
38+
# vite-config-path: vitest.config.ts

packages/notion-to-jsx/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
"url": "https://github.com/01-binary/notion-to-jsx",
99
"directory": "/packages/notion-to-jsx"
1010
},
11-
"scripts": {
12-
"test": "echo \"Error: no test specified\" && exit 1"
13-
},
11+
"scripts": {},
1412
"files": [
1513
"dist"
1614
],

packages/notion-to-utils/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
],
2828
"sideEffects": false,
2929
"scripts": {
30-
"test": "vitest",
30+
"test": "vitest run",
3131
"test:watch": "vitest --watch",
3232
"build": "tsup"
3333
},
@@ -38,6 +38,7 @@
3838
"@repo/eslint-config": "workspace:*",
3939
"@repo/typescript-config": "workspace:*",
4040
"@types/lqip-modern": "^1.1.7",
41+
"@vitest/coverage-v8": "2.1.2",
4142
"typescript": "^5.6.3",
4243
"vitest": "^2.1.2"
4344
},

packages/notion-to-utils/vitest.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
44
test: {
5-
// ... Specify options here.
5+
coverage: {
6+
reporter: ['text', 'json-summary', 'json'],
7+
reportsDirectory: './coverage',
8+
},
69
},
710
});

pnpm-lock.yaml

Lines changed: 137 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)