diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 333fe96..0b5ccf7 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -25,24 +25,18 @@ jobs: FORCE_COLOR: 1 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: "22" - name: Install Dependencies run: npm install --legacy-peer-deps - - name: Start Docker Compose Services - run: docker compose up -d --remove-orphans - - - name: Run Prisma Migrations - run: npm run db:push - - name: Run Tests - run: npx jest --detectOpenHandles --forceExit + run: npm test - name: Stop Docker Compose Services if: always() @@ -52,7 +46,7 @@ jobs: runs-on: ubuntu-latest needs: Test steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Vercel CLI run: npm install --global vercel@latest diff --git a/lib/aws/aws.mod.test.ts b/lib/aws/aws.mod.test.ts index 617a4d5..2a9340a 100644 --- a/lib/aws/aws.mod.test.ts +++ b/lib/aws/aws.mod.test.ts @@ -13,11 +13,11 @@ import { } from "@aws-sdk/client-s3"; describe("AWS S3 integration tests with LocalStack", () => { - beforeAll(async () => { + beforeEach(async () => { try { await s3.send(new CreateBucketCommand({ Bucket: "test-bucket" })); } catch (error) { - console.error("Error in beforeAll bucket creation", error); + console.log(error); } }); diff --git a/package.json b/package.json index dc736c5..d40e92e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "db:format": "npx prisma format", "db:seed": "npx prisma db seed", "db:push": "npx prisma db push", - "test": "docker compose up -d --remove-orphans && npx jest --detectOpenHandles --forceExit --silent" + "test": "docker compose up -d --remove-orphans && npm run db:push && npx jest --detectOpenHandles --forceExit --silent" }, "prisma": { "schema": "lib/db/schema.prisma",