-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.setup.js
More file actions
27 lines (24 loc) · 750 Bytes
/
jest.setup.js
File metadata and controls
27 lines (24 loc) · 750 Bytes
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
import knex from 'knex'
import knexFile from './knexfile'
const conn = knex(knexFile.test)
import { executeSql, deleteFolders } from './test/utils'
beforeAll(async()=>{
try {
await executeSql('CREATE DATABASE IF NOT EXISTS test_example')
} catch (error) {console.log(error)}
await conn.migrate.up()
})
afterAll(async ()=>{
try {
deleteFolders([
'./src/public/uploads/multiple',
'./src/public/uploads/single',
'./src/public/zip',
'./src/public/pdf',
'./src/public/csv',
'./src/public/xlsx',
'./src/public/docx',
])
await executeSql('DROP DATABASE IF EXISTS test_example')
} catch (error) {console.log(error)}
})