From 3bf5f4ae88060a86ab7c1b1468975be43e952521 Mon Sep 17 00:00:00 2001 From: Batur-s Date: Thu, 27 Nov 2025 17:17:26 +0900 Subject: [PATCH 01/15] feat: test with create .env --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..bded9a1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: test with env + +on: [push, pull_request] + +jobs: + build: + name: react build & test + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: .env setting + run: | + echo "Port=3000" >> .env + echo "SESSION_SECRET=your_session_secret" >> .env + echo "JWT_ACCESS_TOKEN_SECRET=your_jwt_access_token_secret" >> .env + echo "JWT_REFRESH_TOKEN_SECRET=your_jwt_refresh_token_secret" >> .env + echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env + echo "AWS_REGION=${{ secrets.AWS_REGION }}" >> .env + echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" >> .env + echo "AWS_S3_BUCKET=${{ secrets.AWS_S3_BUCKET }}" >> .env + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm run test \ No newline at end of file From b82f536b9fe2001c4bf390e89dec40bed80fbb19 Mon Sep 17 00:00:00 2001 From: Batur-s Date: Thu, 27 Nov 2025 17:21:12 +0900 Subject: [PATCH 02/15] fix: test another system --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bded9a1..2d26b78 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,4 +25,4 @@ jobs: run: npm install - name: Run tests - run: npm run test \ No newline at end of file + run: npm test \ No newline at end of file From 31f1dec90a689bbd17807c6d14d664cf3ddcbe8b Mon Sep 17 00:00:00 2001 From: Batur-s Date: Thu, 27 Nov 2025 17:28:29 +0900 Subject: [PATCH 03/15] feat: plus prisma migrate --- .github/workflows/test.yml | 6 + coverage/lcov-report/index.html | 178 +++---- coverage/lcov-report/src/app.ts.html | 2 +- .../src/controllers/alertController.ts.html | 2 +- .../src/controllers/articleController.ts.html | 108 ++-- .../src/controllers/commentController.ts.html | 2 +- .../lcov-report/src/controllers/index.html | 82 +-- .../src/controllers/likeController.ts.html | 2 +- .../src/controllers/photoController.ts.html | 2 +- .../src/controllers/productController.ts.html | 108 ++-- .../src/controllers/userController.ts.html | 66 +-- .../lcov-report/src/dtos/article.dto.ts.html | 28 +- coverage/lcov-report/src/dtos/index.html | 64 +-- .../lcov-report/src/dtos/product.dto.ts.html | 28 +- .../lcov-report/src/dtos/user.dto.ts.html | 2 +- coverage/lcov-report/src/index.html | 2 +- .../lcov-report/src/lib/constants.ts.html | 2 +- .../lcov-report/src/lib/cookieUtil.ts.html | 26 +- coverage/lcov-report/src/lib/index.html | 52 +- .../lcov-report/src/lib/passport/index.html | 64 +-- .../src/lib/passport/index.ts.html | 2 +- .../src/lib/passport/jwtStrategy.ts.html | 40 +- .../src/lib/passport/localStrategy.ts.html | 50 +- coverage/lcov-report/src/lib/prisma.ts.html | 2 +- coverage/lcov-report/src/lib/s3.ts.html | 2 +- coverage/lcov-report/src/lib/token.ts.html | 30 +- .../src/middlewares/errorHandler.ts.html | 2 +- .../lcov-report/src/middlewares/index.html | 2 +- .../src/repositories/alertRepository.ts.html | 2 +- .../repositories/articleRepository.ts.html | 62 +-- .../repositories/commentRepository.ts.html | 2 +- .../lcov-report/src/repositories/index.html | 94 ++-- .../src/repositories/likeRepository.ts.html | 24 +- .../repositories/productRepository.ts.html | 46 +- .../src/repositories/userRepository.ts.html | 24 +- .../src/routers/alertRouter.ts.html | 2 +- .../src/routers/articleRouter.ts.html | 2 +- .../src/routers/commentRouter.ts.html | 2 +- coverage/lcov-report/src/routers/index.html | 40 +- .../lcov-report/src/routers/index.ts.html | 2 +- .../src/routers/likeRouter.ts.html | 2 +- .../src/routers/photoRouter.ts.html | 2 +- .../src/routers/productRouter.ts.html | 2 +- .../src/routers/userRouter.ts.html | 48 +- .../src/services/alertService.ts.html | 2 +- .../src/services/articleService.ts.html | 74 +-- .../src/services/commentService.ts.html | 2 +- coverage/lcov-report/src/services/index.html | 78 +-- .../src/services/likeService.ts.html | 2 +- .../src/services/productService.ts.html | 98 ++-- .../src/services/userService.ts.html | 50 +- coverage/lcov-report/src/socket/index.html | 2 +- coverage/lcov-report/src/socket/io.ts.html | 2 +- .../lcov-report/src/socket/socket.ts.html | 2 +- .../lcov-report/tests/helpers/auth.ts.html | 48 +- coverage/lcov-report/tests/helpers/db.ts.html | 20 +- coverage/lcov-report/tests/helpers/index.html | 48 +- coverage/lcov.info | 502 +++++++++--------- 58 files changed, 1124 insertions(+), 1118 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2d26b78..a1f840e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,12 @@ jobs: echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" >> .env echo "AWS_S3_BUCKET=${{ secrets.AWS_S3_BUCKET }}" >> .env + - name: Prisma Generate + run: npx prisma migrate dev + + - name: Prisma Migrate + run: npx prisma migrate generate + - name: Install dependencies run: npm install diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index a9fe99f..e8bec45 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -23,30 +23,30 @@

All files

- 56.82% + 38.01% Statements - 429/755 + 287/755
- 21.48% + 5.78% Branches - 26/121 + 7/121
- 42.1% + 9.77% Functions - 56/133 + 13/133
- 61.42% + 41.33% Lines - 422/687 + 284/687
@@ -61,7 +61,7 @@

All files

-
+
@@ -95,62 +95,62 @@

All files

- - - - - - - - - + + + + + + + + - - + - - - - - - - - + + + + + + + + - - + - - + + - - - - + + + + - - + - - - - - - - - + + + + + + + + @@ -169,48 +169,48 @@

All files

- - + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + - - - + + + + - - - - + + @@ -229,18 +229,18 @@

All files

- - + - - - - + + + + - - + + @@ -251,7 +251,7 @@

All files

src/controllers -
+
+
32.24%89/2766.38%3/4732.35%11/3436.86%87/23613.04%36/2760%0/472.94%1/3415.25%36/236
src/dtos -
+
src/dtos +
100%17/17100%4/4100%4/4100%17/1776.47%13/170%0/40%0/476.47%13/17
src/lib -
+
src/lib +
81.39%35/4369.76%30/43 50% 4/833.33%2/680.48%33/410%0/668.29%28/41
src/lib/passport -
+
src/lib/passport +
87.87%29/3375%3/475%3/487.87%29/3354.54%18/330%0/40%0/454.54%18/33
src/repositories -
+
src/repositories +
54.23%32/5910%1/1033.33%13/3955.35%31/5625.42%15/590%0/102.56%1/3926.78%15/56
src/routers -
+
+
98.97%97/9850%1/2100%2/2100%97/9792.85%91/980%0/20%0/293.81%91/97
src/services -
+
+
45.03%68/15121.19%32/1510%0/37 16.21% 6/3743.24%16/3751.14%67/13124.42%32/131
tests/helpers -
+
tests/helpers +
95.65%22/2380%4/552.17%12/2360%3/5 100% 2/295.65%22/2352.17%12/23