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
77TZ=UTC
88
99# Server listen to this port
10- PORT=3000
10+ PORT=3001
1111
1212#Cors
1313CORS_URL=*
@@ -20,7 +20,8 @@ DB_MAX_POOL_SIZE=5
2020
2121#localhost or IP of the server
2222# YOUR_TEST_MONGO_DB_HOST_NAME
23- DB_HOST=mongo
23+ DB_HOST=localhost
24+ # DB_HOST=mongo
2425
2526DB_PORT=27017
2627
@@ -31,7 +32,8 @@ DB_USER=blogs-test-db-user
3132DB_USER_PWD=changeit
3233
3334# Redis
34- REDIS_HOST=redis
35+ REDIS_HOST=localhost
36+ # REDIS_HOST=redis
3537REDIS_PORT=6379
3638REDIS_PASSWORD=changeit
3739
Original file line number Diff line number Diff line change @@ -3,12 +3,14 @@ import ApiKey from '../../../src/database/model/ApiKey';
33export const API_KEY = 'abc' ;
44
55export 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 ;
711 else return null ;
812} ) ;
913
1014jest . mock ( '../../../src/database/repository/ApiKeyRepo' , ( ) => ( {
11- get findByKey ( ) {
12- return mockFindApiKey ;
13- } ,
15+ findByKey : mockFindApiKey ,
1416} ) ) ;
You can’t perform that action at this time.
0 commit comments