chore: Test performance and warnings (#1946)
* test: Do not request mailer account in test environment * test: Dupe migrations
This commit is contained in:
@@ -27,7 +27,7 @@ import { createQueue } from "./utils/queue";
|
|||||||
|
|
||||||
const log = debug("emails");
|
const log = debug("emails");
|
||||||
const useTestEmailService =
|
const useTestEmailService =
|
||||||
process.env.NODE_ENV !== "production" && !process.env.SMTP_USERNAME;
|
process.env.NODE_ENV === "development" && !process.env.SMTP_USERNAME;
|
||||||
|
|
||||||
type Emails = "welcome" | "export";
|
type Emails = "welcome" | "export";
|
||||||
|
|
||||||
|
|||||||
@@ -5,27 +5,5 @@ require("dotenv").config({ silent: true });
|
|||||||
process.env.DATABASE_URL = process.env.DATABASE_URL_TEST;
|
process.env.DATABASE_URL = process.env.DATABASE_URL_TEST;
|
||||||
process.env.NODE_ENV = "test";
|
process.env.NODE_ENV = "test";
|
||||||
|
|
||||||
const Sequelize = require("sequelize");
|
|
||||||
const Umzug = require("umzug");
|
|
||||||
const sequelize = require("../sequelize").sequelize;
|
|
||||||
|
|
||||||
const queryInterface = sequelize.getQueryInterface();
|
|
||||||
|
|
||||||
function runMigrations() {
|
|
||||||
const umzug = new Umzug({
|
|
||||||
storage: "sequelize",
|
|
||||||
storageOptions: {
|
|
||||||
sequelize,
|
|
||||||
},
|
|
||||||
migrations: {
|
|
||||||
params: [queryInterface, Sequelize],
|
|
||||||
path: "./server/migrations",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return umzug.up();
|
|
||||||
}
|
|
||||||
|
|
||||||
runMigrations();
|
|
||||||
|
|
||||||
// This is needed for the relative manual mock to be picked up
|
// This is needed for the relative manual mock to be picked up
|
||||||
jest.mock("../events");
|
jest.mock("../events");
|
||||||
|
|||||||
Reference in New Issue
Block a user