From c93e3017a8cb8eaaa2e4c5125cf61fe08f42ad4d Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 30 Aug 2024 10:42:12 -0300 Subject: [PATCH 1/3] build: automacao dos testes do backend --- .github/workflows/jest_tests.yml | 44 +++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/jest_tests.yml b/.github/workflows/jest_tests.yml index fcca85f..531d512 100644 --- a/.github/workflows/jest_tests.yml +++ b/.github/workflows/jest_tests.yml @@ -7,7 +7,8 @@ on: - developer jobs: - test_frontend: + frontend-tests: + name: Frontend Tests runs-on: ubuntu-22.04 steps: @@ -19,6 +20,14 @@ jobs: with: node-version: '20.12.2' + - name: Cache Node.js modules + uses: actions/cache@v3 + with: + path: ./front/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/front/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install dependencies working-directory: ./front run: npm install @@ -29,4 +38,37 @@ jobs: - name: Run tests working-directory: ./front + run: npm test + + backend-tests: + name: Backend Tests + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.12.2' + + - name: Cache Node.js modules + uses: actions/cache@v3 + with: + path: ./backend/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/backend/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install dependencies + working-directory: ./backend + run: npm install + + - name: Run Lint + working-directory: ./backend + run: npm run lint + + - name: Run tests + working-directory: ./backend run: npm test \ No newline at end of file From d8b48d58906c6f4a6eb851fb02f5f8781f8e7743 Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 30 Aug 2024 10:56:56 -0300 Subject: [PATCH 2/3] bugfix: Adicionando o lint nas dependencias do backend --- backend/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 65dcbd7..aa7b29a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -3,7 +3,8 @@ "version": "1.0.0", "main": "index.js", "scripts": { - "test": "jest --passWithNoTests" + "test": "jest --passWithNoTests", + "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "keywords": [], "author": "", From d47d0fcff237303122009296f49cfb2ce5aadd16 Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 30 Aug 2024 11:02:38 -0300 Subject: [PATCH 3/3] build: Adicionando o lint nas devdependencies no backend --- backend/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index aa7b29a..afda9fa 100644 --- a/backend/package.json +++ b/backend/package.json @@ -20,6 +20,7 @@ }, "devDependencies": { "jest": "^29.7.0", - "supertest": "^7.0.0" + "supertest": "^7.0.0", + "eslint": "^8" } }