Destroy old db instance during subscription test when resetting db instance
Test / test (push) Has been cancelled Details

This commit is contained in:
Jeff 2024-10-19 13:22:27 -04:00
parent 20e7099317
commit 206ce42655
3 changed files with 6 additions and 4 deletions

View File

@ -10,7 +10,8 @@ jobs:
- uses: actions/checkout@v4
- name: Install docker
uses: papodaca/install-docker-action@main
- env: NODE_OPTIONS=--max-old-space-size=8192
- name: Run Tests
env: NODE_OPTIONS=--max-old-space-size=8192
run: |
npm install
npm run test

View File

@ -20,7 +20,8 @@ export let db = new Kysely<Database>({
dialect,
})
export function resetDbInstance() {
export async function resetDbInstance() {
await db.destroy()
db = new Kysely<Database>({
dialect,
})

View File

@ -34,8 +34,8 @@ jest.mock("./settings", () => ({
}))
describe("subscriptions", () => {
beforeAll(() => {
resetDbInstance()
beforeAll(async () => {
await resetDbInstance()
})
beforeEach(async () => {