File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const redis = require('../../config/redis')
22const redisClient = redis . redisClient
33const moment = require ( 'moment' )
44const WINDOW_SIZE_IN_HOURS = 24
5- const MAX_WINDOW_REQUEST_COUNT = process . env . NODE_ENV === 'testing' ? 20 : 100
5+ const MAX_WINDOW_REQUEST_COUNT = process . env . NODE_ENV === 'testing' ? 20 : 500
66const WINDOW_LOG_INTERVAL_IN_HOURS = 1
77
88module . exports = {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const HttpStatus = require('http-status-codes')
55const Organization = require ( '../app/models/Organisation' )
66const User = require ( '../app/models/User' )
77const jwt = require ( 'jsonwebtoken' )
8+ const redis = require ( '../config/redis' ) . redisClient
89const adminId = new mongoose . Types . ObjectId ( )
910const moderatorId = new mongoose . Types . ObjectId ( )
1011const randomDigit = Math . floor ( Math . random ( ) * 90 + 10 )
@@ -107,6 +108,7 @@ let server
107108 */
108109beforeAll ( async ( done ) => {
109110 await Organization . deleteMany ( )
111+ await redis . flushall ( )
110112 await new User ( testUser ) . save ( )
111113 server = app . listen ( 4000 , ( ) => {
112114 global . agent = request . agent ( server )
@@ -272,6 +274,8 @@ afterAll(async () => {
272274 await Organization . deleteMany ( )
273275 // delete all the user created
274276 await User . deleteMany ( )
277+ // flush redis
278+ await redis . flushall ( )
275279 // Closing the DB connection allows Jest to exit successfully.
276280 await mongoose . connection . close ( )
277281} )
You can’t perform that action at this time.
0 commit comments