Skip to content

Commit ac6e9f5

Browse files
committed
fix: broken tests in CI
1 parent 5718934 commit ac6e9f5

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ jobs:
4949
run: npm run db:seed
5050

5151
- name: Run tests
52-
run: npm test
52+
run: npm run test:ci

__tests__/cli/project.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ let knex
2424
beforeAll(() => {
2525
knex = knexInit(dbSettings)
2626
})
27-
beforeEach(() => resetDatabase(knex))
27+
beforeEach(async () => {
28+
await resetDatabase(knex)
29+
})
2830
afterEach(jest.clearAllMocks)
2931
afterAll(async () => {
3032
await resetDatabase(knex)

__tests__/utils/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
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+
};
55

66
const getAllProjects = (knex) => knex('projects').select('*')
77
const getAllGithubOrgs = (knex) => knex('github_organizations').select('*')

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"lint:fix": "standard --fix",
99
"test": "jest",
1010
"test:coverage": "jest --coverage",
11+
"test:ci": "jest --runInBand --verbose --coverage",
1112
"infra:start": "docker-compose up -d",
1213
"infra:stop": "docker-compose down",
1314
"db:migrate": "knex migrate:latest",

0 commit comments

Comments
 (0)