chore: Test performance (#5786)
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import { Backlink } from "@server/models";
|
||||
import { buildDocument } from "@server/test/factories";
|
||||
import { setupTestDatabase } from "@server/test/support";
|
||||
import BacklinksProcessor from "./BacklinksProcessor";
|
||||
|
||||
const ip = "127.0.0.1";
|
||||
|
||||
setupTestDatabase();
|
||||
|
||||
describe("documents.publish", () => {
|
||||
test("should create new backlink records", async () => {
|
||||
const otherDocument = await buildDocument();
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { Revision } from "@server/models";
|
||||
import { buildDocument } from "@server/test/factories";
|
||||
import { setupTestDatabase } from "@server/test/support";
|
||||
import RevisionsProcessor from "./RevisionsProcessor";
|
||||
|
||||
const ip = "127.0.0.1";
|
||||
|
||||
setupTestDatabase();
|
||||
|
||||
describe("documents.update.debounced", () => {
|
||||
test("should create a revision", async () => {
|
||||
const document = await buildDocument();
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import path from "path";
|
||||
import { glob } from "glob";
|
||||
import env from "@server/env";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import { requireDirectory } from "@server/utils/fs";
|
||||
import BaseProcessor from "./BaseProcessor";
|
||||
|
||||
const processors = {};
|
||||
const rootDir = env.ENVIRONMENT === "test" ? "" : "build";
|
||||
|
||||
requireDirectory<{ default: BaseProcessor }>(__dirname).forEach(
|
||||
([module, id]) => {
|
||||
@@ -16,7 +18,7 @@ requireDirectory<{ default: BaseProcessor }>(__dirname).forEach(
|
||||
);
|
||||
|
||||
glob
|
||||
.sync("build/plugins/*/server/processors/!(*.test).js")
|
||||
.sync(path.join(rootDir, "plugins/*/server/processors/!(*.test).[jt]s"))
|
||||
.forEach((filePath: string) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const processor = require(path.join(process.cwd(), filePath)).default;
|
||||
|
||||
Reference in New Issue
Block a user