Skip to content

Commit 91aec3f

Browse files
authored
Fix recurring test timeouts (#748)
* feat: add write permissions to the pull request to report test coverage * feat: prevent lingering connections in tests
1 parent 2e11c92 commit 91aec3f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ jobs:
5959
vitest:
6060
name: ⚡ Test
6161
runs-on: ubuntu-latest
62+
permissions:
63+
# Required to checkout the code
64+
contents: read
65+
# Required to put a comment into the pull-request
66+
pull-requests: write
6267
steps:
6368
- name: ⬇️ Checkout repo
6469
uses: actions/checkout@v6

vitest.setup.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import '@testing-library/jest-dom'
22
import { cleanup } from '@testing-library/react'
33
import { afterEach } from 'vitest'
4+
import { pg } from '~/db.server'
45

56
export const BASE_URL = 'http://localhost:4200'
67

78
afterEach(() => {
89
cleanup()
910
})
11+
12+
afterAll(async () => {
13+
// prevent lingering connections from
14+
// blocking other test suites
15+
await pg.end()
16+
})

0 commit comments

Comments
 (0)