File tree 7 files changed +18
-22
lines changed
7 files changed +18
-22
lines changed Original file line number Diff line number Diff line change 7
7
push :
8
8
branches :
9
9
- feat-test-CI-implementation-187419042
10
+ - " *"
10
11
- develop
12
+
11
13
pull_request :
12
14
branches :
13
15
- develop
38
40
- name : Run tests and build test coverage
39
41
run : npm run test:ci
40
42
41
- - name : Test & publish code coverage
43
+ - name : Test & publish code climate coverage
42
44
43
45
env :
44
46
CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
Original file line number Diff line number Diff line change 1
1
[ ![ Coverage Status] ( https://coveralls.io/repos/github/atlp-rwanda/hackers-ec-be/badge.svg?branch=feat-test-CI-implementation-187419042 )] ( https://coveralls.io/github/atlp-rwanda/hackers-ec-be?branch=feat-test-CI-implementation-187419042 )
2
-
3
2
[ ![ Maintainability] ( https://api.codeclimate.com/v1/badges/0f9cac26fd6bc0a2f7a9/maintainability )] ( https://codeclimate.com/github/atlp-rwanda/hackers-ec-be/maintainability )
4
-
5
3
[ ![ Test Coverage] ( https://api.codeclimate.com/v1/badges/0f9cac26fd6bc0a2f7a9/test_coverage )] ( https://codeclimate.com/github/atlp-rwanda/hackers-ec-be/test_coverage )
6
-
7
4
![ ] ( https://img.shields.io/badge/Express.js-404D59?style=for-the-badge )
8
-
9
5
![ ] ( https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white )
10
-
11
6
![ ] ( https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white )
12
-
13
7
![ ] ( https://img.shields.io/badge/sequelize-323330?style=for-the-badge&logo=sequelize&logoColor=blue )
14
8
15
9
![ ] ( https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white )
16
-
17
10
![ ] ( https://img.shields.io/badge/GitHub_Actions-2088FF?style=for-the-badge&logo=github-actions&logoColor=white )
18
-
19
11
![ ] ( https://img.shields.io/badge/Jest-323330?style=for-the-badge&logo=Jest&logoColor=white )
20
-
21
12
![ ] ( https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white )
22
13
23
14
# hackers-ec-be
Original file line number Diff line number Diff line change 13
13
"seed:undo" : " npx sequelize-cli db:seed:undo:all" ,
14
14
"test" : " jest --no-cache --detectOpenHandles" ,
15
15
"test-test" : " jest --watchAll --no-cache --detectOpenHandles" ,
16
- "test:ci" : " jest --detectOpenHandles --coverage"
16
+ "test:ci" : " jest --detectOpenHandles --coverage --verbose "
17
17
},
18
18
"keywords" : [],
19
19
"author" : " " ,
35
35
"sequelize" : " ^6.37.3" ,
36
36
"uuid" : " ^9.0.0"
37
37
},
38
-
39
38
"transform" : {
40
39
"^.+\\ .(ts|tsx)?$" : " ts-jest" ,
41
40
"^.+\\ .(js|jsx)$" : " babel-jest" ,
60
59
" json-summary" ,
61
60
" text" ,
62
61
" lcov"
62
+ ],
63
+ "coveragePathIgnorePatterns" : [
64
+ " /src/database/config/db.config.ts"
63
65
]
64
66
},
65
67
"devDependencies" : {
87
89
"ts-node-dev" : " ^2.0.0" ,
88
90
"typescript" : " ^5.4.5"
89
91
}
90
- }
92
+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ describe("LOGIN API TEST", () => {
11
11
12
12
it ( "should login successfully with correct credentials" , async ( ) => {
13
13
// Your test implementation goes here
14
+ const { body } = await request ( app ) . get ( "" )
15
+ console . log ( body ) ;
14
16
} ) ;
15
17
it ( "should return 401 for login with incorrect credentials" , async ( ) => {
16
18
// Your test implementation goes here
Original file line number Diff line number Diff line change 1
1
import app from "../app" ;
2
2
import request from "supertest" ;
3
- import { connectionToDatabase } from "../database/config/db.config" ;
3
+ // import { connectionToDatabase } from "../database/config/db.config";
4
4
5
5
jest . setTimeout ( 30000 ) ;
6
6
7
7
describe ( "PRODUCT API TEST" , ( ) => {
8
- beforeAll ( async ( ) => {
9
- await connectionToDatabase ( ) ;
10
- } ) ;
8
+ // beforeAll(async () => {
9
+ // await connectionToDatabase();
10
+ // });
11
11
12
12
it ( "Seller should create a product" , async ( ) => {
13
13
// Your test implementation goes here
Original file line number Diff line number Diff line change 1
1
import app from "../app" ;
2
2
import request from "supertest" ;
3
- import { connectionToDatabase } from "../database/config/db.config" ;
3
+ // import { connectionToDatabase } from "../database/config/db.config";
4
4
5
5
jest . setTimeout ( 30000 ) ;
6
6
7
7
describe ( "USER API TEST" , ( ) => {
8
- beforeAll ( async ( ) => {
9
- await connectionToDatabase ( ) ;
10
- } ) ;
8
+ // beforeAll(async () => {
9
+ // await connectionToDatabase();
10
+ // });
11
11
12
12
it ( "Should return 200 and list of all users" , async ( ) => {
13
13
// Your test implementation goes here
Original file line number Diff line number Diff line change 1
- import "reflect-metadata" ;
2
1
import app from "./app" ;
3
2
import { PORT } from "./utils/keys" ;
4
3
import { connectionToDatabase } from "./database/config/db.config" ;
You can’t perform that action at this time.
0 commit comments