diff --git a/packages/backend/src/server/api/SkRateLimiterService.ts b/packages/backend/src/server/api/SkRateLimiterService.ts index 05166ed93c..b11d1556ba 100644 --- a/packages/backend/src/server/api/SkRateLimiterService.ts +++ b/packages/backend/src/server/api/SkRateLimiterService.ts @@ -24,7 +24,7 @@ export class SkRateLimiterService { @Inject(EnvService) envService: EnvService, ) { - this.disabled = envService.env.NODE_ENV !== 'production'; + this.disabled = envService.env.NODE_ENV === 'test'; } public async limit(limit: Keyed, actor: string, factor = 1): Promise { diff --git a/packages/backend/test/unit/server/api/SkRateLimiterServiceTests.ts b/packages/backend/test/unit/server/api/SkRateLimiterServiceTests.ts index 871c9afa64..90030495ed 100644 --- a/packages/backend/test/unit/server/api/SkRateLimiterServiceTests.ts +++ b/packages/backend/test/unit/server/api/SkRateLimiterServiceTests.ts @@ -120,7 +120,7 @@ describe(SkRateLimiterService, () => { }); }); - it('should bypass in non-production', async () => { + it('should bypass in test environment', async () => { mockEnvironment.NODE_ENV = 'test'; const info = await serviceUnderTest().limit({ key: 'l', type: undefined, max: 0 }, actor);