Files
outline/server/test/setup.ts
codegen-sh[bot] a8e4e0166c fix: remove transaction override to prevent savepoint conflicts
The transaction-based approach was conflicting with the application's own
transaction middleware, causing 'SAVEPOINT can only be used in transaction blocks' errors.

Keeping the core performance improvement of removing expensive CASCADE operations
while maintaining Jest configuration optimizations for better parallelization.
2025-07-16 14:08:21 +00:00

49 lines
1.1 KiB
TypeScript

import "reflect-metadata";
import sharedEnv from "@shared/env";
import env from "@server/env";
import Redis from "@server/storage/redis";
require("@server/storage/database");
jest.mock("bull");
// Enable mocks for Redis-related modules
jest.mock("@server/storage/redis");
jest.mock("@server/utils/MutexLock");
jest.mock("@server/utils/CacheHelper");
// This is needed for the relative manual mock to be picked up
jest.mock("../queues");
// We never want to make real S3 requests in test environment
jest.mock("@aws-sdk/client-s3", () => ({
S3Client: jest.fn(() => ({
send: jest.fn(),
})),
DeleteObjectCommand: jest.fn(),
GetObjectCommand: jest.fn(),
ObjectCannedACL: {},
}));
jest.mock("@aws-sdk/lib-storage", () => ({
Upload: jest.fn(() => ({
done: jest.fn(),
})),
}));
jest.mock("@aws-sdk/s3-presigned-post", () => ({
createPresignedPost: jest.fn(),
}));
jest.mock("@aws-sdk/s3-request-presigner", () => ({
getSignedUrl: jest.fn(),
}));
afterAll(() => {
Redis.defaultClient.disconnect();
});
beforeEach(() => {
env.URL = sharedEnv.URL = "https://app.outline.dev";
});