test: comprehensive test suites and quality gates pass across backend, storefront and admin
- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation. - Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings. - Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors. - Fixed unmount lifecycle guards, promise error handling, and component edge cases.
This commit is contained in:
1 parent
1e73715169
commit
ddbf1ca026
439 files changed
+32911
-6107
No files matched your search
+45
-45
@@ -1,42 +1,42 @@
|
||||
import { Module, NestModule, MiddlewareConsumer } from '@nestjs/common';
|
||||
import { PrismaModule } from './prisma/prisma.module';
|
||||
import { ProductsModule } from './products/products.module';
|
||||
import { UsersModule } from './users/users.module';
|
||||
import { RedisModule } from './redis/redis.module';
|
||||
import { RedisService } from './redis/redis.service';
|
||||
import { AuthModule } from './auth/auth.module';
|
||||
import { PetsModule } from './pets/pets.module';
|
||||
import { OrdersModule } from './orders/orders.module';
|
||||
import { SettingsModule } from './settings/settings.module';
|
||||
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { CsrfGuard } from './common/guards/csrf.guard';
|
||||
import { MetricsController } from './common/metrics.controller';
|
||||
import { AdminModule } from './admin/admin.module';
|
||||
import { HomeModule } from './home/home.module';
|
||||
import { BlogsModule } from './blogs/blogs.module';
|
||||
import { WikiModule } from './wiki/wiki.module';
|
||||
import { SeoModule } from './seo/seo.module';
|
||||
import { CmsModule } from './cms/cms.module';
|
||||
import { WholesaleModule } from './wholesale/wholesale.module';
|
||||
import { VideosModule } from './videos/videos.module';
|
||||
import { SmsModule } from './common/sms.module';
|
||||
import { ContactModule } from './contact/contact.module';
|
||||
import { BannersModule } from './banners/banners.module';
|
||||
import { SmartAdvisorModule } from './smart-advisor/smart-advisor.module';
|
||||
import { TestimonialsModule } from './testimonials/testimonials.module';
|
||||
import { IngredientsModule } from './ingredients/ingredients.module';
|
||||
import { PrescriptionsModule } from './prescriptions/prescriptions.module';
|
||||
import { B2BModule } from './b2b/b2b.module';
|
||||
import { PaymentModule } from './payment/payment.module';
|
||||
import { TicketsModule } from './tickets/tickets.module';
|
||||
import { ReviewsModule } from './reviews/reviews.module';
|
||||
import { DoctorsModule } from './doctors/doctors.module';
|
||||
import { FaqModule } from './faq/faq.module';
|
||||
import { MenuModule } from './menu/menu.module';
|
||||
import { RevalidationModule } from './common/revalidation/revalidation.module';
|
||||
import { Module, NestModule, MiddlewareConsumer } from "@nestjs/common";
|
||||
import { PrismaModule } from "./prisma/prisma.module";
|
||||
import { ProductsModule } from "./products/products.module";
|
||||
import { UsersModule } from "./users/users.module";
|
||||
import { RedisModule } from "./redis/redis.module";
|
||||
import { RedisService } from "./redis/redis.service";
|
||||
import { AuthModule } from "./auth/auth.module";
|
||||
import { PetsModule } from "./pets/pets.module";
|
||||
import { OrdersModule } from "./orders/orders.module";
|
||||
import { SettingsModule } from "./settings/settings.module";
|
||||
import { ThrottlerModule, ThrottlerGuard } from "@nestjs/throttler";
|
||||
import { APP_GUARD } from "@nestjs/core";
|
||||
import { CsrfGuard } from "./common/guards/csrf.guard";
|
||||
import { MetricsController } from "./common/metrics.controller";
|
||||
import { AdminModule } from "./admin/admin.module";
|
||||
import { HomeModule } from "./home/home.module";
|
||||
import { BlogsModule } from "./blogs/blogs.module";
|
||||
import { WikiModule } from "./wiki/wiki.module";
|
||||
import { SeoModule } from "./seo/seo.module";
|
||||
import { CmsModule } from "./cms/cms.module";
|
||||
import { WholesaleModule } from "./wholesale/wholesale.module";
|
||||
import { VideosModule } from "./videos/videos.module";
|
||||
import { SmsModule } from "./common/sms.module";
|
||||
import { ContactModule } from "./contact/contact.module";
|
||||
import { BannersModule } from "./banners/banners.module";
|
||||
import { SmartAdvisorModule } from "./smart-advisor/smart-advisor.module";
|
||||
import { TestimonialsModule } from "./testimonials/testimonials.module";
|
||||
import { IngredientsModule } from "./ingredients/ingredients.module";
|
||||
import { PrescriptionsModule } from "./prescriptions/prescriptions.module";
|
||||
import { B2BModule } from "./b2b/b2b.module";
|
||||
import { PaymentModule } from "./payment/payment.module";
|
||||
import { TicketsModule } from "./tickets/tickets.module";
|
||||
import { ReviewsModule } from "./reviews/reviews.module";
|
||||
import { DoctorsModule } from "./doctors/doctors.module";
|
||||
import { FaqModule } from "./faq/faq.module";
|
||||
import { MenuModule } from "./menu/menu.module";
|
||||
import { RevalidationModule } from "./common/revalidation/revalidation.module";
|
||||
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@@ -99,24 +99,24 @@ export class AppModule implements NestModule {
|
||||
.apply((req: Request, res: Response, next: NextFunction) => {
|
||||
MetricsController.incrementRequestCount();
|
||||
|
||||
const url: string = req.originalUrl || req.url || '';
|
||||
const method: string = req.method || '';
|
||||
const url: string = req.originalUrl || req.url || "";
|
||||
const method: string = req.method || "";
|
||||
|
||||
// Exclude options, admin panel requests, static assets, and health metrics from visit counter
|
||||
const isAdminPath =
|
||||
url.includes('/admin') || url.includes('/api/admin');
|
||||
url.includes("/admin") || url.includes("/api/admin");
|
||||
const isStaticAsset = url.match(
|
||||
/\.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|map)$/i,
|
||||
);
|
||||
const isIgnoredMethod = method === 'OPTIONS' || method === 'HEAD';
|
||||
const isIgnoredMethod = method === "OPTIONS" || method === "HEAD";
|
||||
|
||||
if (!isAdminPath && !isStaticAsset && !isIgnoredMethod) {
|
||||
const todayKey = `visits:${new Date().toISOString().split('T')[0]}`;
|
||||
const todayKey = `visits:${new Date().toISOString().split("T")[0]}`;
|
||||
this.redisService.incr(todayKey, 86400).catch(() => {});
|
||||
}
|
||||
next();
|
||||
})
|
||||
.exclude('metrics')
|
||||
.forRoutes('*');
|
||||
.exclude("metrics")
|
||||
.forRoutes("*");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user