File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 49
49
run : npm run db:seed
50
50
51
51
- name : Run tests
52
- run : npm test
52
+ run : npm run test:ci
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ let knex
24
24
beforeAll ( ( ) => {
25
25
knex = knexInit ( dbSettings )
26
26
} )
27
- beforeEach ( ( ) => resetDatabase ( knex ) )
27
+ beforeEach ( async ( ) => {
28
+ await resetDatabase ( knex )
29
+ } )
28
30
afterEach ( jest . clearAllMocks )
29
31
afterAll ( async ( ) => {
30
32
await resetDatabase ( knex )
Original file line number Diff line number Diff line change 1
1
const resetDatabase = async ( knex ) => {
2
- await knex ( ' github_organizations' ) . del ( )
3
- await knex ( ' projects' ) . del ( )
4
- }
2
+ await knex . raw ( 'TRUNCATE TABLE github_organizations RESTART IDENTITY CASCADE' ) ;
3
+ await knex . raw ( 'TRUNCATE TABLE projects RESTART IDENTITY CASCADE' ) ;
4
+ } ;
5
5
6
6
const getAllProjects = ( knex ) => knex ( 'projects' ) . select ( '*' )
7
7
const getAllGithubOrgs = ( knex ) => knex ( 'github_organizations' ) . select ( '*' )
Original file line number Diff line number Diff line change 8
8
"lint:fix" : " standard --fix" ,
9
9
"test" : " jest" ,
10
10
"test:coverage" : " jest --coverage" ,
11
+ "test:ci" : " jest --runInBand --verbose --coverage" ,
11
12
"infra:start" : " docker-compose up -d" ,
12
13
"infra:stop" : " docker-compose down" ,
13
14
"db:migrate" : " knex migrate:latest" ,
You can’t perform that action at this time.
0 commit comments