mirror of
https://github.com/outline/outline.git
synced 2026-11-21 05:24:03 +03:00
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.
49 lines
1.1 KiB
TypeScript
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";
|
|
});
|