-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvowfile.js
More file actions
50 lines (44 loc) · 1.59 KB
/
vowfile.js
File metadata and controls
50 lines (44 loc) · 1.59 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
'use strict'
const ace = require('@adonisjs/ace')
module.exports = (cli, runner) => {
runner.before(async () => {
/*
|--------------------------------------------------------------------------
| Start the server
|--------------------------------------------------------------------------
*/
use('Adonis/Src/Server').listen(process.env.HOST, process.env.PORT)
/*
|--------------------------------------------------------------------------
| Run migrations
|--------------------------------------------------------------------------
|
| Automatically run migrations to create the test database schema.
|
*/
await ace.call('migration:run', {}, { silent: true })
/*
|--------------------------------------------------------------------------
| Seed the database
|--------------------------------------------------------------------------
|
| Run the regular application seeders to populate lookup/reference tables
| (e.g. user_types, access_permissions). These are the same seeders used
| by the main app — they run once before all tests.
|
*/
await ace.call('seed', {}, { silent: true })
})
runner.after(async () => {
/*
|--------------------------------------------------------------------------
| Rollback migrations
|--------------------------------------------------------------------------
|
| Clean up the test database after all tests have completed.
|
*/
await ace.call('migration:rollback', {}, { silent: true })
use('Adonis/Src/Server').getInstance().close()
})
}