chore: api v2 esModuleInterop more imports (#26755)

This commit is contained in:
Morgan authored and GitHub committed 2026-01-12 11:39:01 -03:00
1 parent d24807e0e1
commit c7cd25b7d5
3 files changed
+8 -8

No files matched your search

@@ -1,10 +1,10 @@
import { Injectable, NestMiddleware } from "@nestjs/common";
import * as bodyParser from "body-parser";
import { json } from "body-parser";
import type { Request, Response } from "express";
@Injectable()
export class JsonBodyMiddleware implements NestMiddleware {
use(req: Request, res: Response, next: () => any) {
bodyParser.json()(req, res, next);
use(req: Request, res: Response, next: () => any): void {
json()(req, res, next);
}
}
@@ -1,10 +1,10 @@
import { Injectable, NestMiddleware } from "@nestjs/common";
import * as bodyParser from "body-parser";
import { raw } from "body-parser";
import type { Request, Response } from "express";
@Injectable()
export class RawBodyMiddleware implements NestMiddleware {
use(req: Request, res: Response, next: () => any) {
bodyParser.raw({ type: "*/*" })(req, res, next);
use(req: Request, res: Response, next: () => any): void {
raw({ type: "*/*" })(req, res, next);
}
}
@@ -4,7 +4,7 @@ import { AccessScope, OAuthClientType } from "@calcom/prisma/enums";
import { INestApplication } from "@nestjs/common";
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test, TestingModule } from "@nestjs/testing";
import * as nextAuthJwt from "next-auth/jwt";
import { getToken } from "next-auth/jwt";
import request from "supertest";
import { MembershipRepositoryFixture } from "test/fixtures/repository/membership.repository.fixture";
import { OAuth2ClientRepositoryFixture } from "test/fixtures/repository/oauth2-client.repository.fixture";
@@ -24,7 +24,7 @@ import { UsersModule } from "@/modules/users/users.module";
jest.mock("next-auth/jwt", () => ({
getToken: jest.fn(),
}));
const mockGetToken = nextAuthJwt.getToken as jest.MockedFunction<typeof nextAuthJwt.getToken>;
const mockGetToken = getToken as jest.MockedFunction<typeof getToken>;
describe("OAuth2 Controller Endpoints", () => {
describe("User Not Authenticated", () => {