mirror of
https://github.com/outline/outline.git
synced 2026-01-05 18:49:53 -06:00
* chore: refactor server test setup * Close dangling redis connections instead of mocking rate limiter specific modules * Segregate pre and post env test setup * fix: remove mock file
32 lines
819 B
TypeScript
32 lines
819 B
TypeScript
import Redis from "@server/redis";
|
|
|
|
// NOTE: this require must come after the ENV var override
|
|
// so that sequelize uses the test config variables
|
|
require("@server/database/sequelize");
|
|
|
|
jest.mock("bull");
|
|
|
|
// This is needed for the relative manual mock to be picked up
|
|
jest.mock("../queues");
|
|
|
|
// Avoid "Yjs was already imported" errors in the test environment
|
|
jest.mock("yjs");
|
|
|
|
// We never want to make real S3 requests in test environment
|
|
jest.mock("aws-sdk", () => {
|
|
const mS3 = {
|
|
createPresignedPost: jest.fn(),
|
|
putObject: jest.fn().mockReturnThis(),
|
|
deleteObject: jest.fn().mockReturnThis(),
|
|
promise: jest.fn(),
|
|
};
|
|
return {
|
|
S3: jest.fn(() => mS3),
|
|
Endpoint: jest.fn(),
|
|
};
|
|
});
|
|
|
|
jest.mock("@getoutline/y-prosemirror", () => ({}));
|
|
|
|
afterAll(() => Redis.defaultClient.disconnect());
|