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 - uses: actions/checkout@v4
- name: Install docker - name: Install docker
uses: papodaca/install-docker-action@main 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: | run: |
npm install npm install
npm run test npm run test

View File

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

View File

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