Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion routes/zone_record.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const testZoneRecord = {

before(async () => {
await ZoneRecord.destroy({ id: testZoneRecordId })
await ZoneRecord.destroy({ id: bystanderId })
await Zone.destroy({ id: testZoneId })

const testGroup = { ...groupCase, id: testGroupId }
Expand Down Expand Up @@ -69,7 +70,9 @@ after(async () => {
await ZoneRecord.destroy({ id: testZoneRecordId })
await ZoneRecord.destroy({ id: bystanderId })
await Zone.destroy({ id: testZoneId })
await server.stop()
// a failed before() leaves no server, and an open db connection keeps node running
if (server) await server.stop()
else await ZoneRecord.disconnect()
})

describe('zone_record routes', () => {
Expand Down
Loading