File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ NODE_ENV=test
7
7
TZ=UTC
8
8
9
9
# Server listen to this port
10
- PORT=3000
10
+ PORT=3001
11
11
12
12
#Cors
13
13
CORS_URL=*
@@ -20,7 +20,8 @@ DB_MAX_POOL_SIZE=5
20
20
21
21
#localhost or IP of the server
22
22
# YOUR_TEST_MONGO_DB_HOST_NAME
23
- DB_HOST=mongo
23
+ DB_HOST=localhost
24
+ # DB_HOST=mongo
24
25
25
26
DB_PORT=27017
26
27
@@ -31,7 +32,8 @@ DB_USER=blogs-test-db-user
31
32
DB_USER_PWD=changeit
32
33
33
34
# Redis
34
- REDIS_HOST=redis
35
+ REDIS_HOST=localhost
36
+ # REDIS_HOST=redis
35
37
REDIS_PORT=6379
36
38
REDIS_PASSWORD=changeit
37
39
Original file line number Diff line number Diff line change @@ -3,12 +3,14 @@ import ApiKey from '../../../src/database/model/ApiKey';
3
3
export const API_KEY = 'abc' ;
4
4
5
5
export const mockFindApiKey = jest . fn ( async ( key : string ) => {
6
- if ( key == API_KEY ) return { key : API_KEY } as ApiKey ;
6
+ if ( key == API_KEY )
7
+ return {
8
+ key : API_KEY ,
9
+ permissions : [ 'GENERAL' ] ,
10
+ } as ApiKey ;
7
11
else return null ;
8
12
} ) ;
9
13
10
14
jest . mock ( '../../../src/database/repository/ApiKeyRepo' , ( ) => ( {
11
- get findByKey ( ) {
12
- return mockFindApiKey ;
13
- } ,
15
+ findByKey : mockFindApiKey ,
14
16
} ) ) ;
You can’t perform that action at this time.
0 commit comments