diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4115c082..06bc924a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -59,6 +59,11 @@ jobs: vitest: name: ⚡ Test runs-on: ubuntu-latest + permissions: + # Required to checkout the code + contents: read + # Required to put a comment into the pull-request + pull-requests: write steps: - name: ⬇️ Checkout repo uses: actions/checkout@v6 diff --git a/vitest.setup.ts b/vitest.setup.ts index 5cd429e8..554ccf72 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -1,9 +1,16 @@ import '@testing-library/jest-dom' import { cleanup } from '@testing-library/react' import { afterEach } from 'vitest' +import { pg } from '~/db.server' export const BASE_URL = 'http://localhost:4200' afterEach(() => { cleanup() }) + +afterAll(async () => { + // prevent lingering connections from + // blocking other test suites + await pg.end() +})