chore: refactor server test setup (#3976)

* chore: refactor server test setup

* Close dangling redis connections instead of mocking rate limiter
  specific modules
* Segregate pre and post env test setup

* fix: remove mock file
This commit is contained in:
Apoorv Mishra
2022-08-16 09:16:57 +05:30
committed by GitHub
parent 93bb9d067d
commit 7a758f84a0
4 changed files with 21 additions and 45 deletions

View File

@@ -1,28 +0,0 @@
export default class MockRateLimiter {
static getRateLimiter() {
return {
points: 100,
consume: jest.fn(),
};
}
static setRateLimiter() {
//
}
static hasRateLimiter() {
return false;
}
}
export const RateLimiterStrategy = new Proxy(
{},
{
get() {
return {
duration: 60,
requests: 10,
};
},
}
);