-
Notifications
You must be signed in to change notification settings - Fork 1
/
setupIntegrationTests.ts
35 lines (32 loc) · 970 Bytes
/
setupIntegrationTests.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { toIncludeSameMembers } from 'jest-extended'
import { jest } from '@jest/globals'
import {
Attachment,
Author,
EventLog,
Grader,
Program,
ProgramManagement,
StudyTrack,
Supervision,
Thesis,
User,
} from './src/server/db/models'
expect.extend({ toIncludeSameMembers })
global.jest = jest
global.afterEach(async () => {
await Attachment.destroy({ where: {} })
await Supervision.destroy({ where: {} })
await Author.destroy({ where: {} })
await Thesis.destroy({ where: {} })
await User.destroy({ where: {} })
await StudyTrack.destroy({ where: {} })
await Program.destroy({ where: {} })
await Grader.destroy({ where: {} })
await ProgramManagement.destroy({ where: {} })
await EventLog.destroy({ where: {} })
// TODO: Departments should be cleaned up here too,
// but integration tests are failing atm if I do it here.
// We need to fix department / department admin integration tests
// and add the cleanup here.
})