From ec0564eb32bbf3835a5cdb985b9e9beb860ad04e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 6 Sep 2023 17:19:21 -0400 Subject: [PATCH] chore: Test performance (#5786) --- .circleci/config.yml | 4 +- .jestconfig.json | 6 +- package.json | 7 +- plugins/slack/server/api/hooks.test.ts | 23 +- plugins/slack/server/api/hooks.ts | 4 +- .../processors/WebhookProcessor.test.ts | 3 - .../CleanupWebhookDeliveriesTask.test.ts | 3 - .../server/tasks/DeliverWebhookTask.test.ts | 3 - server/commands/accountProvisioner.test.ts | 15 +- server/commands/commentCreator.test.ts | 4 +- server/commands/commentDestroyer.test.ts | 4 +- server/commands/documentImporter.test.ts | 3 - server/commands/documentMover.test.ts | 3 - .../commands/documentPermanentDeleter.test.ts | 3 - server/commands/documentUpdater.test.ts | 4 +- server/commands/fileOperationDeleter.test.ts | 3 - server/commands/notificationUpdater.test.ts | 6 +- server/commands/pinCreator.test.ts | 4 +- server/commands/pinDestroyer.test.ts | 4 +- server/commands/revisionCreator.test.ts | 8 +- server/commands/starCreator.test.ts | 4 +- server/commands/starDestroyer.test.ts | 4 +- server/commands/starUpdater.test.ts | 4 +- server/commands/subscriptionCreator.test.ts | 3 - server/commands/subscriptionDestroyer.test.ts | 3 - server/commands/teamPermanentDeleter.test.ts | 3 - server/commands/teamProvisioner.test.ts | 22 +- server/commands/userDemoter.test.ts | 3 - server/commands/userDestroyer.test.ts | 3 - server/commands/userInviter.test.ts | 3 - server/commands/userProvisioner.test.ts | 29 +- server/commands/userSuspender.test.ts | 3 - server/commands/userUnsuspender.test.ts | 3 - server/middlewares/authentication.test.ts | 3 - server/models/Collection.test.ts | 3 - server/models/Document.test.ts | 3 - server/models/Revision.test.ts | 3 - server/models/Team.test.ts | 3 - server/models/TeamDomain.test.ts | 4 +- server/models/User.test.ts | 3 - server/models/helpers/SearchHelper.test.ts | 3 - server/policies/collection.test.ts | 3 - server/policies/document.test.ts | 3 - server/policies/index.test.ts | 3 - server/policies/team.test.ts | 8 +- .../processors/BacklinksProcessor.test.ts | 3 - .../processors/RevisionsProcessor.test.ts | 3 - server/queues/processors/index.ts | 4 +- .../tasks/CleanupDeletedDocumentsTask.test.ts | 3 - .../tasks/CleanupDemotedUserTask.test.ts | 3 - .../CleanupExpiredFileOperationsTask.test.ts | 3 - .../DetachDraftsFromCollectionTask.test.ts | 3 - ...DocumentPublishedNotificationsTask.test.ts | 3 - .../ErrorTimedOutFileOperationsTask.test.ts | 3 - .../tasks/ImportMarkdownZipTask.test.ts | 3 - server/queues/tasks/ImportNotionTask.test.ts | 3 - .../queues/tasks/InviteReminderTask.test.ts | 3 - .../RevisionCreatedNotificationsTask.test.ts | 3 - server/queues/tasks/index.ts | 4 +- server/routes/api/auth/auth.test.ts | 3 +- server/routes/api/documents/documents.test.ts | 4 - server/routes/api/documents/documents.ts | 5 +- server/routes/api/teams/teams.test.ts | 38 +- server/test/factories.ts | 4 +- server/test/globalSetup.ts | 15 + server/test/globalTeardown.ts | 5 + server/test/setup.ts | 2 - server/test/support.ts | 25 - yarn.lock | 678 +++++++++--------- 69 files changed, 449 insertions(+), 617 deletions(-) create mode 100644 server/test/globalSetup.ts create mode 100644 server/test/globalTeardown.ts diff --git a/.circleci/config.yml b/.circleci/config.yml index 2f1183406..930e34901 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,7 +82,7 @@ jobs: command: yarn test:shared test-server: <<: *defaults - parallelism: 4 + parallelism: 3 steps: - checkout - restore_cache: @@ -94,7 +94,7 @@ jobs: name: test command: | TESTFILES=$(circleci tests glob "server/**/*.test.ts" | circleci tests split) - yarn test $TESTFILES --forceExit + yarn test $TESTFILES bundle-size: <<: *defaults environment: diff --git a/.jestconfig.json b/.jestconfig.json index 3c471750e..79a01a187 100644 --- a/.jestconfig.json +++ b/.jestconfig.json @@ -1,5 +1,6 @@ { "workerIdleMemoryLimit": "0.75", + "maxWorkers": "1", "projects": [ { "displayName": "server", @@ -13,8 +14,9 @@ "/server/test/env.ts" ], "setupFilesAfterEnv": ["/server/test/setup.ts"], - "testEnvironment": "node", - "runner": "@getoutline/jest-runner-serial" + "globalSetup": "/server/test/globalSetup.ts", + "globalTeardown": "/server/test/globalTeardown.ts", + "testEnvironment": "node" }, { "displayName": "app", diff --git a/package.json b/package.json index 07e77e587..4cc6e9546 100644 --- a/package.json +++ b/package.json @@ -231,7 +231,6 @@ "@babel/cli": "^7.21.5", "@babel/preset-typescript": "^7.21.4", "@faker-js/faker": "^8.0.2", - "@getoutline/jest-runner-serial": "^2.0.0", "@relative-ci/agent": "^4.1.3", "@types/addressparser": "^1.0.1", "@types/body-scroll-lock": "^3.1.0", @@ -296,7 +295,7 @@ "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "babel-eslint": "^10.1.0", - "babel-jest": "^29.6.3", + "babel-jest": "^29.6.4", "babel-plugin-transform-inline-environment-variables": "^0.4.4", "babel-plugin-transform-typescript-metadata": "^0.3.2", "babel-plugin-tsconfig-paths-module-resolver": "^1.0.4", @@ -318,8 +317,8 @@ "fetch-test-server": "^1.1.0", "husky": "^8.0.2", "i18next-parser": "^7.9.0", - "jest-cli": "^29.6.1", - "jest-environment-jsdom": "^29.5.0", + "jest-cli": "^29.6.4", + "jest-environment-jsdom": "^29.6.4", "jest-fetch-mock": "^3.0.3", "lint-staged": "^13.2.3", "nodemon": "^2.0.22", diff --git a/plugins/slack/server/api/hooks.test.ts b/plugins/slack/server/api/hooks.test.ts index e65b4b2ef..26f552a07 100644 --- a/plugins/slack/server/api/hooks.test.ts +++ b/plugins/slack/server/api/hooks.test.ts @@ -152,22 +152,15 @@ describe("#hooks.slack", () => { }, }); - return new Promise((resolve) => { - // setTimeout is needed here because SearchQuery is saved asynchronously - // in order to not slow down the response time. - setTimeout(async () => { - const searchQuery = await SearchQuery.findAll({ - where: { - teamId: team.id, - query: "contains", - }, - }); - expect(searchQuery.length).toBe(1); - expect(searchQuery[0].results).toBe(0); - expect(searchQuery[0].source).toBe("slack"); - resolve(undefined); - }, 250); + const searchQuery = await SearchQuery.findAll({ + where: { + teamId: team.id, + query: "contains", + }, }); + expect(searchQuery.length).toBe(1); + expect(searchQuery[0].results).toBe(0); + expect(searchQuery[0].source).toBe("slack"); }); it("should respond with help content for help keyword", async () => { diff --git a/plugins/slack/server/api/hooks.ts b/plugins/slack/server/api/hooks.ts index 0a426210b..72555f6af 100644 --- a/plugins/slack/server/api/hooks.ts +++ b/plugins/slack/server/api/hooks.ts @@ -335,14 +335,12 @@ router.post( ? await SearchHelper.searchForUser(user, text, options) : await SearchHelper.searchForTeam(team, text, options); - void SearchQuery.create({ + await SearchQuery.create({ userId: user ? user.id : null, teamId: team.id, source: "slack", query: text, results: totalCount, - }).catch((err) => { - Logger.error("Failed to create search query", err); }); const haventSignedIn = t( diff --git a/plugins/webhooks/server/processors/WebhookProcessor.test.ts b/plugins/webhooks/server/processors/WebhookProcessor.test.ts index 73bafa1be..c8fa0480f 100644 --- a/plugins/webhooks/server/processors/WebhookProcessor.test.ts +++ b/plugins/webhooks/server/processors/WebhookProcessor.test.ts @@ -1,5 +1,4 @@ import { buildUser, buildWebhookSubscription } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import { UserEvent } from "@server/types"; import DeliverWebhookTask from "../tasks/DeliverWebhookTask"; import WebhookProcessor from "./WebhookProcessor"; @@ -7,8 +6,6 @@ import WebhookProcessor from "./WebhookProcessor"; jest.mock("../tasks/DeliverWebhookTask"); const ip = "127.0.0.1"; -setupTestDatabase(); - beforeEach(async () => { jest.resetAllMocks(); }); diff --git a/plugins/webhooks/server/tasks/CleanupWebhookDeliveriesTask.test.ts b/plugins/webhooks/server/tasks/CleanupWebhookDeliveriesTask.test.ts index 7dd82526a..a66fc13fa 100644 --- a/plugins/webhooks/server/tasks/CleanupWebhookDeliveriesTask.test.ts +++ b/plugins/webhooks/server/tasks/CleanupWebhookDeliveriesTask.test.ts @@ -1,11 +1,8 @@ import { subDays } from "date-fns"; import { WebhookDelivery } from "@server/models"; import { buildWebhookDelivery } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import CleanupWebhookDeliveriesTask from "./CleanupWebhookDeliveriesTask"; -setupTestDatabase(); - const deliveryExists = async (delivery: WebhookDelivery) => { const results = await WebhookDelivery.findOne({ where: { id: delivery.id } }); return !!results; diff --git a/plugins/webhooks/server/tasks/DeliverWebhookTask.test.ts b/plugins/webhooks/server/tasks/DeliverWebhookTask.test.ts index 50a11bb2b..cf4aab8de 100644 --- a/plugins/webhooks/server/tasks/DeliverWebhookTask.test.ts +++ b/plugins/webhooks/server/tasks/DeliverWebhookTask.test.ts @@ -6,12 +6,9 @@ import { buildWebhookDelivery, buildWebhookSubscription, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import { UserEvent } from "@server/types"; import DeliverWebhookTask from "./DeliverWebhookTask"; -setupTestDatabase(); - beforeEach(async () => { jest.resetAllMocks(); fetchMock.resetMocks(); diff --git a/server/commands/accountProvisioner.test.ts b/server/commands/accountProvisioner.test.ts index 0687581a4..5b555309f 100644 --- a/server/commands/accountProvisioner.test.ts +++ b/server/commands/accountProvisioner.test.ts @@ -5,15 +5,9 @@ import { TeamDomain } from "@server/models"; import Collection from "@server/models/Collection"; import UserAuthentication from "@server/models/UserAuthentication"; import { buildUser, buildTeam, buildAdmin } from "@server/test/factories"; -import { - setupTestDatabase, - setCloudHosted, - setSelfHosted, -} from "@server/test/support"; +import { setCloudHosted, setSelfHosted } from "@server/test/support"; import accountProvisioner from "./accountProvisioner"; -setupTestDatabase(); - describe("accountProvisioner", () => { const ip = "127.0.0.1"; @@ -371,7 +365,7 @@ describe("accountProvisioner", () => { }, authenticationProvider: { name: "google", - providerId: "example-company.com", + providerId: faker.internet.domainName(), }, authentication: { providerId: uuidv4(), @@ -390,6 +384,7 @@ describe("accountProvisioner", () => { it("should always use existing team if self-hosted", async () => { const team = await buildTeam(); + const domain = faker.internet.domainName(); const { user, isNewUser } = await accountProvisioner({ ip, user: { @@ -402,11 +397,11 @@ describe("accountProvisioner", () => { name: team.name, avatarUrl: team.avatarUrl, subdomain: faker.internet.domainWord(), - domain: "allowed-domain.com", + domain, }, authenticationProvider: { name: "google", - providerId: "allowed-domain.com", + providerId: domain, }, authentication: { providerId: uuidv4(), diff --git a/server/commands/commentCreator.test.ts b/server/commands/commentCreator.test.ts index 92686fffd..9f41ecb4f 100644 --- a/server/commands/commentCreator.test.ts +++ b/server/commands/commentCreator.test.ts @@ -1,9 +1,7 @@ import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import commentCreator from "./commentCreator"; -setupTestDatabase(); - describe("commentCreator", () => { const ip = "127.0.0.1"; diff --git a/server/commands/commentDestroyer.test.ts b/server/commands/commentDestroyer.test.ts index b05442c56..e2eb6ee9a 100644 --- a/server/commands/commentDestroyer.test.ts +++ b/server/commands/commentDestroyer.test.ts @@ -1,10 +1,8 @@ import { Comment } from "@server/models"; import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import commentDestroyer from "./commentDestroyer"; -setupTestDatabase(); - describe("commentDestroyer", () => { const ip = "127.0.0.1"; diff --git a/server/commands/documentImporter.test.ts b/server/commands/documentImporter.test.ts index 7a712c83d..f35e23cdf 100644 --- a/server/commands/documentImporter.test.ts +++ b/server/commands/documentImporter.test.ts @@ -2,13 +2,10 @@ import path from "path"; import fs from "fs-extra"; import Attachment from "@server/models/Attachment"; import { buildUser } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import documentImporter from "./documentImporter"; jest.mock("@server/storage/files"); -setupTestDatabase(); - describe("documentImporter", () => { const ip = "127.0.0.1"; diff --git a/server/commands/documentMover.test.ts b/server/commands/documentMover.test.ts index a1e9506ca..27ed38b74 100644 --- a/server/commands/documentMover.test.ts +++ b/server/commands/documentMover.test.ts @@ -6,11 +6,8 @@ import { buildTeam, buildUser, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import documentMover from "./documentMover"; -setupTestDatabase(); - describe("documentMover", () => { const ip = "127.0.0.1"; diff --git a/server/commands/documentPermanentDeleter.test.ts b/server/commands/documentPermanentDeleter.test.ts index 99cfb148f..64c0ed555 100644 --- a/server/commands/documentPermanentDeleter.test.ts +++ b/server/commands/documentPermanentDeleter.test.ts @@ -2,13 +2,10 @@ import { subDays } from "date-fns"; import { Attachment, Document } from "@server/models"; import DeleteAttachmentTask from "@server/queues/tasks/DeleteAttachmentTask"; import { buildAttachment, buildDocument } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import documentPermanentDeleter from "./documentPermanentDeleter"; jest.mock("@server/queues/tasks/DeleteAttachmentTask"); -setupTestDatabase(); - describe("documentPermanentDeleter", () => { it("should destroy documents", async () => { const document = await buildDocument({ diff --git a/server/commands/documentUpdater.test.ts b/server/commands/documentUpdater.test.ts index a7c274c1d..05f3d9d20 100644 --- a/server/commands/documentUpdater.test.ts +++ b/server/commands/documentUpdater.test.ts @@ -1,10 +1,8 @@ import { sequelize } from "@server/storage/database"; import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import documentUpdater from "./documentUpdater"; -setupTestDatabase(); - describe("documentUpdater", () => { const ip = "127.0.0.1"; diff --git a/server/commands/fileOperationDeleter.test.ts b/server/commands/fileOperationDeleter.test.ts index 45989d2df..d2349e1b6 100644 --- a/server/commands/fileOperationDeleter.test.ts +++ b/server/commands/fileOperationDeleter.test.ts @@ -1,10 +1,7 @@ import { FileOperation } from "@server/models"; import { buildAdmin, buildFileOperation } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import fileOperationDeleter from "./fileOperationDeleter"; -setupTestDatabase(); - describe("fileOperationDeleter", () => { const ip = "127.0.0.1"; diff --git a/server/commands/notificationUpdater.test.ts b/server/commands/notificationUpdater.test.ts index 669d3b80d..c93065843 100644 --- a/server/commands/notificationUpdater.test.ts +++ b/server/commands/notificationUpdater.test.ts @@ -6,11 +6,9 @@ import { buildDocument, buildCollection, } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import notificationUpdater from "./notificationUpdater"; -setupTestDatabase(); - describe("notificationUpdater", () => { const ip = "127.0.0.1"; @@ -48,7 +46,7 @@ describe("notificationUpdater", () => { transaction, }) ); - const event = await findLatestEvent({}); + const event = await findLatestEvent(); expect(notification.viewedAt).not.toBe(null); expect(notification.archivedAt).toBe(null); diff --git a/server/commands/pinCreator.test.ts b/server/commands/pinCreator.test.ts index c24fb0766..3605926e8 100644 --- a/server/commands/pinCreator.test.ts +++ b/server/commands/pinCreator.test.ts @@ -1,9 +1,7 @@ import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import pinCreator from "./pinCreator"; -setupTestDatabase(); - describe("pinCreator", () => { const ip = "127.0.0.1"; diff --git a/server/commands/pinDestroyer.test.ts b/server/commands/pinDestroyer.test.ts index 0db3d83ea..9d131d49c 100644 --- a/server/commands/pinDestroyer.test.ts +++ b/server/commands/pinDestroyer.test.ts @@ -1,10 +1,8 @@ import { Pin } from "@server/models"; import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import pinDestroyer from "./pinDestroyer"; -setupTestDatabase(); - describe("pinCreator", () => { const ip = "127.0.0.1"; diff --git a/server/commands/revisionCreator.test.ts b/server/commands/revisionCreator.test.ts index 1e0cf41ef..854b18f9d 100644 --- a/server/commands/revisionCreator.test.ts +++ b/server/commands/revisionCreator.test.ts @@ -1,9 +1,7 @@ import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import revisionCreator from "./revisionCreator"; -setupTestDatabase(); - describe("revisionCreator", () => { const ip = "127.0.0.1"; @@ -18,7 +16,9 @@ describe("revisionCreator", () => { user, ip, }); - const event = await findLatestEvent(); + const event = await findLatestEvent({ + teamId: user.teamId, + }); expect(revision.documentId).toEqual(document.id); expect(revision.userId).toEqual(user.id); expect(revision.createdAt).toEqual(document.updatedAt); diff --git a/server/commands/starCreator.test.ts b/server/commands/starCreator.test.ts index 8a0de9e2b..69a18d563 100644 --- a/server/commands/starCreator.test.ts +++ b/server/commands/starCreator.test.ts @@ -1,11 +1,9 @@ import { Star, Event } from "@server/models"; import { sequelize } from "@server/storage/database"; import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import starCreator from "./starCreator"; -setupTestDatabase(); - describe("starCreator", () => { const ip = "127.0.0.1"; diff --git a/server/commands/starDestroyer.test.ts b/server/commands/starDestroyer.test.ts index 0524d07cd..144b8fc97 100644 --- a/server/commands/starDestroyer.test.ts +++ b/server/commands/starDestroyer.test.ts @@ -1,10 +1,8 @@ import { Star } from "@server/models"; import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import starDestroyer from "./starDestroyer"; -setupTestDatabase(); - describe("starDestroyer", () => { const ip = "127.0.0.1"; diff --git a/server/commands/starUpdater.test.ts b/server/commands/starUpdater.test.ts index 674878bc5..836ea9e7a 100644 --- a/server/commands/starUpdater.test.ts +++ b/server/commands/starUpdater.test.ts @@ -1,10 +1,8 @@ import { Star } from "@server/models"; import { buildDocument, buildUser } from "@server/test/factories"; -import { findLatestEvent, setupTestDatabase } from "@server/test/support"; +import { findLatestEvent } from "@server/test/support"; import starUpdater from "./starUpdater"; -setupTestDatabase(); - describe("starUpdater", () => { const ip = "127.0.0.1"; diff --git a/server/commands/subscriptionCreator.test.ts b/server/commands/subscriptionCreator.test.ts index fa7632fce..1716e2ee6 100644 --- a/server/commands/subscriptionCreator.test.ts +++ b/server/commands/subscriptionCreator.test.ts @@ -1,12 +1,9 @@ import { Subscription, Event } from "@server/models"; import { sequelize } from "@server/storage/database"; import { buildDocument, buildUser } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import subscriptionCreator from "./subscriptionCreator"; import subscriptionDestroyer from "./subscriptionDestroyer"; -setupTestDatabase(); - describe("subscriptionCreator", () => { const ip = "127.0.0.1"; const subscribedEvent = "documents.update"; diff --git a/server/commands/subscriptionDestroyer.test.ts b/server/commands/subscriptionDestroyer.test.ts index 91ac202d7..a25bf2ea9 100644 --- a/server/commands/subscriptionDestroyer.test.ts +++ b/server/commands/subscriptionDestroyer.test.ts @@ -5,11 +5,8 @@ import { buildSubscription, buildUser, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import subscriptionDestroyer from "./subscriptionDestroyer"; -setupTestDatabase(); - describe("subscriptionDestroyer", () => { const ip = "127.0.0.1"; diff --git a/server/commands/teamPermanentDeleter.test.ts b/server/commands/teamPermanentDeleter.test.ts index 9ae68137a..0d59b05d6 100644 --- a/server/commands/teamPermanentDeleter.test.ts +++ b/server/commands/teamPermanentDeleter.test.ts @@ -6,11 +6,8 @@ import { buildTeam, buildDocument, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import teamPermanentDeleter from "./teamPermanentDeleter"; -setupTestDatabase(); - describe("teamPermanentDeleter", () => { it("should destroy related data", async () => { const team = await buildTeam({ diff --git a/server/commands/teamProvisioner.test.ts b/server/commands/teamProvisioner.test.ts index 0690db6a0..0f039df43 100644 --- a/server/commands/teamProvisioner.test.ts +++ b/server/commands/teamProvisioner.test.ts @@ -1,15 +1,9 @@ import { faker } from "@faker-js/faker"; import TeamDomain from "@server/models/TeamDomain"; import { buildTeam, buildUser } from "@server/test/factories"; -import { - setCloudHosted, - setSelfHosted, - setupTestDatabase, -} from "@server/test/support"; +import { setCloudHosted, setSelfHosted } from "@server/test/support"; import teamProvisioner from "./teamProvisioner"; -setupTestDatabase(); - describe("teamProvisioner", () => { const ip = "127.0.0.1"; @@ -104,12 +98,14 @@ describe("teamProvisioner", () => { }); it("should error on mismatched team and authentication provider", async () => { + const subdomain = faker.internet.domainWord(); + const exampleTeam = await buildTeam({ - subdomain: faker.internet.domainWord(), + subdomain, authenticationProviders: [ { name: "google", - providerId: "teamProvisioner3.com", + providerId: `${subdomain}.com`, }, ], }); @@ -215,9 +211,11 @@ describe("teamProvisioner", () => { const user = await buildUser({ teamId: existing.id, }); + const allowedDomain = faker.internet.domainName(); + const otherDomain = faker.internet.domainName(); await TeamDomain.create({ teamId: existing.id, - name: "allowed-domain.com", + name: allowedDomain, createdById: user.id, }); @@ -226,11 +224,11 @@ describe("teamProvisioner", () => { await teamProvisioner({ name: "Updated name", subdomain: faker.internet.domainWord(), - domain: "other-domain.com", + domain: otherDomain, teamId: existing.id, authenticationProvider: { name: "google", - providerId: "other-domain.com", + providerId: otherDomain, }, ip, }); diff --git a/server/commands/userDemoter.test.ts b/server/commands/userDemoter.test.ts index ef0a0c5ff..6c14c8682 100644 --- a/server/commands/userDemoter.test.ts +++ b/server/commands/userDemoter.test.ts @@ -1,11 +1,8 @@ import { CollectionPermission, UserRole } from "@shared/types"; import { CollectionUser } from "@server/models"; import { buildUser, buildAdmin, buildCollection } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import userDemoter from "./userDemoter"; -setupTestDatabase(); - describe("userDemoter", () => { const ip = "127.0.0.1"; diff --git a/server/commands/userDestroyer.test.ts b/server/commands/userDestroyer.test.ts index 3fd60acb9..d8bc2992d 100644 --- a/server/commands/userDestroyer.test.ts +++ b/server/commands/userDestroyer.test.ts @@ -1,9 +1,6 @@ import { buildUser, buildAdmin } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import userDestroyer from "./userDestroyer"; -setupTestDatabase(); - describe("userDestroyer", () => { const ip = "127.0.0.1"; diff --git a/server/commands/userInviter.test.ts b/server/commands/userInviter.test.ts index 03847a4b6..6fd81e904 100644 --- a/server/commands/userInviter.test.ts +++ b/server/commands/userInviter.test.ts @@ -1,11 +1,8 @@ import { faker } from "@faker-js/faker"; import { UserRole } from "@shared/types"; import { buildUser } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import userInviter from "./userInviter"; -setupTestDatabase(); - describe("userInviter", () => { const ip = "127.0.0.1"; diff --git a/server/commands/userProvisioner.test.ts b/server/commands/userProvisioner.test.ts index ce7770c05..2740387cd 100644 --- a/server/commands/userProvisioner.test.ts +++ b/server/commands/userProvisioner.test.ts @@ -1,3 +1,4 @@ +import { faker } from "@faker-js/faker"; import { v4 as uuidv4 } from "uuid"; import { TeamDomain } from "@server/models"; import { @@ -6,11 +7,8 @@ import { buildInvite, buildAdmin, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import userProvisioner from "./userProvisioner"; -setupTestDatabase(); - describe("userProvisioner", () => { const ip = "127.0.0.1"; @@ -338,17 +336,19 @@ describe("userProvisioner", () => { it("should create a user from allowed domain", async () => { const team = await buildTeam(); const admin = await buildAdmin({ teamId: team.id }); + const domain = faker.internet.domainName(); await TeamDomain.create({ teamId: team.id, - name: "example-company.com", + name: domain, createdById: admin.id, }); const authenticationProviders = await team.$get("authenticationProviders"); const authenticationProvider = authenticationProviders[0]; + const email = faker.internet.email({ provider: domain }); const result = await userProvisioner({ - name: "Test Name", - email: "user@example-company.com", + name: faker.person.fullName(), + email, teamId: team.id, ip, authentication: { @@ -363,28 +363,31 @@ describe("userProvisioner", () => { expect(authentication?.accessToken).toEqual("123"); expect(authentication?.scopes.length).toEqual(1); expect(authentication?.scopes[0]).toEqual("read"); - expect(user.email).toEqual("user@example-company.com"); + expect(user.email).toEqual(email); expect(isNewUser).toEqual(true); }); it("should create a user from allowed domain with emailMatchOnly", async () => { const team = await buildTeam(); const admin = await buildAdmin({ teamId: team.id }); + const domain = faker.internet.domainName(); + const email = faker.internet.email({ provider: domain }); + await TeamDomain.create({ teamId: team.id, - name: "example-company.com", + name: domain, createdById: admin.id, }); const result = await userProvisioner({ name: "Test Name", - email: "user@example-company.com", + email, teamId: team.id, ip, }); const { user, authentication, isNewUser } = result; expect(authentication).toBeUndefined(); - expect(user.email).toEqual("user@example-company.com"); + expect(user.email).toEqual(email); expect(isNewUser).toEqual(true); }); @@ -395,7 +398,7 @@ describe("userProvisioner", () => { try { await userProvisioner({ name: "Test Name", - email: "user@example-company.com", + email: faker.internet.email(), teamId: team.id, ip, }); @@ -411,7 +414,7 @@ describe("userProvisioner", () => { const admin = await buildAdmin({ teamId: team.id }); await TeamDomain.create({ teamId: team.id, - name: "other.com", + name: faker.internet.domainName(), createdById: admin.id, }); @@ -422,7 +425,7 @@ describe("userProvisioner", () => { try { await userProvisioner({ name: "Bad Domain User", - email: "user@example.com", + email: faker.internet.domainName(), teamId: team.id, ip, authentication: { diff --git a/server/commands/userSuspender.test.ts b/server/commands/userSuspender.test.ts index aa6380711..cdcd5fc45 100644 --- a/server/commands/userSuspender.test.ts +++ b/server/commands/userSuspender.test.ts @@ -1,10 +1,7 @@ import GroupUser from "@server/models/GroupUser"; import { buildGroup, buildAdmin, buildUser } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import userSuspender from "./userSuspender"; -setupTestDatabase(); - describe("userSuspender", () => { const ip = "127.0.0.1"; diff --git a/server/commands/userUnsuspender.test.ts b/server/commands/userUnsuspender.test.ts index 6269f6b7a..182da4411 100644 --- a/server/commands/userUnsuspender.test.ts +++ b/server/commands/userUnsuspender.test.ts @@ -1,9 +1,6 @@ import { buildAdmin, buildUser } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import userUnsuspender from "./userUnsuspender"; -setupTestDatabase(); - describe("userUnsuspender", () => { const ip = "127.0.0.1"; diff --git a/server/middlewares/authentication.test.ts b/server/middlewares/authentication.test.ts index c14fc39e6..29c4af230 100644 --- a/server/middlewares/authentication.test.ts +++ b/server/middlewares/authentication.test.ts @@ -2,11 +2,8 @@ import { DefaultState } from "koa"; import randomstring from "randomstring"; import ApiKey from "@server/models/ApiKey"; import { buildUser, buildTeam } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import auth from "./authentication"; -setupTestDatabase(); - describe("Authentication middleware", () => { describe("with JWT", () => { it("should authenticate with correct token", async () => { diff --git a/server/models/Collection.test.ts b/server/models/Collection.test.ts index 159dcd634..78a32f213 100644 --- a/server/models/Collection.test.ts +++ b/server/models/Collection.test.ts @@ -7,13 +7,10 @@ import { buildTeam, buildDocument, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import slugify from "@server/utils/slugify"; import Collection from "./Collection"; import Document from "./Document"; -setupTestDatabase(); - beforeEach(() => { jest.resetAllMocks(); }); diff --git a/server/models/Document.test.ts b/server/models/Document.test.ts index 8ba89ab09..1c84a45b1 100644 --- a/server/models/Document.test.ts +++ b/server/models/Document.test.ts @@ -6,11 +6,8 @@ import { buildTeam, buildUser, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import slugify from "@server/utils/slugify"; -setupTestDatabase(); - beforeEach(() => { jest.resetAllMocks(); }); diff --git a/server/models/Revision.test.ts b/server/models/Revision.test.ts index 97659fc48..cc6349e1e 100644 --- a/server/models/Revision.test.ts +++ b/server/models/Revision.test.ts @@ -1,9 +1,6 @@ import { buildDocument } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import Revision from "./Revision"; -setupTestDatabase(); - describe("#findLatest", () => { test("should return latest revision", async () => { const document = await buildDocument({ diff --git a/server/models/Team.test.ts b/server/models/Team.test.ts index 2ed05fdb5..5c5194752 100644 --- a/server/models/Team.test.ts +++ b/server/models/Team.test.ts @@ -1,7 +1,4 @@ import { buildTeam, buildCollection } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; - -setupTestDatabase(); describe("collectionIds", () => { it("should return non-private collection ids", async () => { diff --git a/server/models/TeamDomain.test.ts b/server/models/TeamDomain.test.ts index feb917cf2..e59ededf6 100644 --- a/server/models/TeamDomain.test.ts +++ b/server/models/TeamDomain.test.ts @@ -1,9 +1,7 @@ import { buildAdmin, buildTeam } from "@server/test/factories"; -import { setCloudHosted, setupTestDatabase } from "@server/test/support"; +import { setCloudHosted } from "@server/test/support"; import TeamDomain from "./TeamDomain"; -setupTestDatabase(); - describe("team domain model", () => { beforeEach(setCloudHosted); diff --git a/server/models/User.test.ts b/server/models/User.test.ts index 401be8de2..59924326f 100644 --- a/server/models/User.test.ts +++ b/server/models/User.test.ts @@ -1,11 +1,8 @@ import { CollectionPermission } from "@shared/types"; import { buildUser, buildTeam, buildCollection } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import CollectionUser from "./CollectionUser"; import UserAuthentication from "./UserAuthentication"; -setupTestDatabase(); - beforeAll(() => { jest.useFakeTimers().setSystemTime(new Date("2018-01-02T00:00:00.000Z")); }); diff --git a/server/models/helpers/SearchHelper.test.ts b/server/models/helpers/SearchHelper.test.ts index b95f9186f..80f57ad16 100644 --- a/server/models/helpers/SearchHelper.test.ts +++ b/server/models/helpers/SearchHelper.test.ts @@ -7,9 +7,6 @@ import { buildUser, buildShare, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; - -setupTestDatabase(); beforeEach(() => { jest.resetAllMocks(); diff --git a/server/policies/collection.test.ts b/server/policies/collection.test.ts index 03b9e352c..989d9ed46 100644 --- a/server/policies/collection.test.ts +++ b/server/policies/collection.test.ts @@ -6,11 +6,8 @@ import { buildCollection, buildAdmin, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import { serialize } from "./index"; -setupTestDatabase(); - describe("admin", () => { it("should allow updating collection but not reading documents", async () => { const team = await buildTeam(); diff --git a/server/policies/document.test.ts b/server/policies/document.test.ts index 61358f37a..a0f0bc7f9 100644 --- a/server/policies/document.test.ts +++ b/server/policies/document.test.ts @@ -6,11 +6,8 @@ import { buildDraftDocument, buildCollection, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import { serialize } from "./index"; -setupTestDatabase(); - describe("read_write collection", () => { it("should allow read write permissions for member", async () => { const team = await buildTeam(); diff --git a/server/policies/index.test.ts b/server/policies/index.test.ts index 0a2b92669..6d8b1c5e0 100644 --- a/server/policies/index.test.ts +++ b/server/policies/index.test.ts @@ -1,9 +1,6 @@ import { buildUser, buildTeam } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import { serialize } from "./index"; -setupTestDatabase(); - it("should serialize policy", async () => { const user = await buildUser(); const response = serialize(user, user); diff --git a/server/policies/team.test.ts b/server/policies/team.test.ts index 365819c0e..7e19e6a9a 100644 --- a/server/policies/team.test.ts +++ b/server/policies/team.test.ts @@ -1,13 +1,7 @@ import { buildUser, buildTeam, buildAdmin } from "@server/test/factories"; -import { - setCloudHosted, - setSelfHosted, - setupTestDatabase, -} from "@server/test/support"; +import { setCloudHosted, setSelfHosted } from "@server/test/support"; import { serialize } from "./index"; -setupTestDatabase(); - it("should allow reading only", async () => { await setSelfHosted(); diff --git a/server/queues/processors/BacklinksProcessor.test.ts b/server/queues/processors/BacklinksProcessor.test.ts index 24fd18da7..4ae37b72a 100644 --- a/server/queues/processors/BacklinksProcessor.test.ts +++ b/server/queues/processors/BacklinksProcessor.test.ts @@ -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(); diff --git a/server/queues/processors/RevisionsProcessor.test.ts b/server/queues/processors/RevisionsProcessor.test.ts index 749fa5ea7..c2d3fc40d 100644 --- a/server/queues/processors/RevisionsProcessor.test.ts +++ b/server/queues/processors/RevisionsProcessor.test.ts @@ -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(); diff --git a/server/queues/processors/index.ts b/server/queues/processors/index.ts index 4ebe1dacb..6afcdd7fe 100644 --- a/server/queues/processors/index.ts +++ b/server/queues/processors/index.ts @@ -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; diff --git a/server/queues/tasks/CleanupDeletedDocumentsTask.test.ts b/server/queues/tasks/CleanupDeletedDocumentsTask.test.ts index 623bd2266..d67096cc3 100644 --- a/server/queues/tasks/CleanupDeletedDocumentsTask.test.ts +++ b/server/queues/tasks/CleanupDeletedDocumentsTask.test.ts @@ -1,11 +1,8 @@ import { subDays } from "date-fns"; import { Document } from "@server/models"; import { buildDocument, buildTeam } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import CleanupDeletedDocumentsTask from "./CleanupDeletedDocumentsTask"; -setupTestDatabase(); - describe("CleanupDeletedDocumentsTask", () => { it("should not destroy documents not deleted", async () => { const team = await buildTeam(); diff --git a/server/queues/tasks/CleanupDemotedUserTask.test.ts b/server/queues/tasks/CleanupDemotedUserTask.test.ts index ca8aaa7c4..ab173c7a6 100644 --- a/server/queues/tasks/CleanupDemotedUserTask.test.ts +++ b/server/queues/tasks/CleanupDemotedUserTask.test.ts @@ -6,11 +6,8 @@ import { buildWebhookSubscription, buildViewer, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import CleanupDemotedUserTask from "./CleanupDemotedUserTask"; -setupTestDatabase(); - describe("CleanupDemotedUserTask", () => { it("should delete api keys for suspended user", async () => { const admin = await buildAdmin(); diff --git a/server/queues/tasks/CleanupExpiredFileOperationsTask.test.ts b/server/queues/tasks/CleanupExpiredFileOperationsTask.test.ts index dcd715718..1af1608c6 100644 --- a/server/queues/tasks/CleanupExpiredFileOperationsTask.test.ts +++ b/server/queues/tasks/CleanupExpiredFileOperationsTask.test.ts @@ -2,11 +2,8 @@ import { subDays } from "date-fns"; import { FileOperationState, FileOperationType } from "@shared/types"; import { FileOperation } from "@server/models"; import { buildFileOperation, buildTeam } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import CleanupExpiredFileOperationsTask from "./CleanupExpiredFileOperationsTask"; -setupTestDatabase(); - describe("CleanupExpiredFileOperationsTask", () => { it("should expire exports older than 15 days ago", async () => { const team = await buildTeam(); diff --git a/server/queues/tasks/DetachDraftsFromCollectionTask.test.ts b/server/queues/tasks/DetachDraftsFromCollectionTask.test.ts index 3582fd996..e926708cf 100644 --- a/server/queues/tasks/DetachDraftsFromCollectionTask.test.ts +++ b/server/queues/tasks/DetachDraftsFromCollectionTask.test.ts @@ -1,10 +1,7 @@ import { Document } from "@server/models"; import { buildCollection, buildDocument } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import DetachDraftsFromCollectionTask from "./DetachDraftsFromCollectionTask"; -setupTestDatabase(); - describe("DetachDraftsFromCollectionTask", () => { const ip = "127.0.0.1"; it("should detach drafts from deleted collection", async () => { diff --git a/server/queues/tasks/DocumentPublishedNotificationsTask.test.ts b/server/queues/tasks/DocumentPublishedNotificationsTask.test.ts index 4b31e7711..17a513ee6 100644 --- a/server/queues/tasks/DocumentPublishedNotificationsTask.test.ts +++ b/server/queues/tasks/DocumentPublishedNotificationsTask.test.ts @@ -5,13 +5,10 @@ import { buildCollection, buildUser, } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import DocumentPublishedNotificationsTask from "./DocumentPublishedNotificationsTask"; const ip = "127.0.0.1"; -setupTestDatabase(); - beforeEach(async () => { jest.resetAllMocks(); }); diff --git a/server/queues/tasks/ErrorTimedOutFileOperationsTask.test.ts b/server/queues/tasks/ErrorTimedOutFileOperationsTask.test.ts index d6a00c59a..caf55e17a 100644 --- a/server/queues/tasks/ErrorTimedOutFileOperationsTask.test.ts +++ b/server/queues/tasks/ErrorTimedOutFileOperationsTask.test.ts @@ -2,11 +2,8 @@ import { subDays } from "date-fns"; import { FileOperationState, FileOperationType } from "@shared/types"; import { FileOperation } from "@server/models"; import { buildFileOperation, buildTeam } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import ErrorTimedOutFileOperationsTask from "./ErrorTimedOutFileOperationsTask"; -setupTestDatabase(); - describe("ErrorTimedOutFileOperationsTask", () => { it("should error exports older than 12 hours", async () => { const team = await buildTeam(); diff --git a/server/queues/tasks/ImportMarkdownZipTask.test.ts b/server/queues/tasks/ImportMarkdownZipTask.test.ts index a5d47cab8..61f144c07 100644 --- a/server/queues/tasks/ImportMarkdownZipTask.test.ts +++ b/server/queues/tasks/ImportMarkdownZipTask.test.ts @@ -2,11 +2,8 @@ import fs from "fs"; import path from "path"; import { FileOperation } from "@server/models"; import { buildFileOperation } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import ImportMarkdownZipTask from "./ImportMarkdownZipTask"; -setupTestDatabase(); - describe("ImportMarkdownZipTask", () => { it("should import the documents, attachments", async () => { const fileOperation = await buildFileOperation(); diff --git a/server/queues/tasks/ImportNotionTask.test.ts b/server/queues/tasks/ImportNotionTask.test.ts index 25034333d..66421f052 100644 --- a/server/queues/tasks/ImportNotionTask.test.ts +++ b/server/queues/tasks/ImportNotionTask.test.ts @@ -2,11 +2,8 @@ import fs from "fs"; import path from "path"; import { FileOperation } from "@server/models"; import { buildFileOperation } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import ImportNotionTask from "./ImportNotionTask"; -setupTestDatabase(); - describe("ImportNotionTask", () => { it("should import successfully from a Markdown export", async () => { const fileOperation = await buildFileOperation(); diff --git a/server/queues/tasks/InviteReminderTask.test.ts b/server/queues/tasks/InviteReminderTask.test.ts index 687851c74..760d78350 100644 --- a/server/queues/tasks/InviteReminderTask.test.ts +++ b/server/queues/tasks/InviteReminderTask.test.ts @@ -1,11 +1,8 @@ import { subDays } from "date-fns"; import InviteReminderEmail from "@server/emails/templates/InviteReminderEmail"; import { buildInvite } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import InviteReminderTask from "./InviteReminderTask"; -setupTestDatabase(); - describe("InviteReminderTask", () => { it("should not destroy documents not deleted", async () => { const spy = jest.spyOn(InviteReminderEmail.prototype, "schedule"); diff --git a/server/queues/tasks/RevisionCreatedNotificationsTask.test.ts b/server/queues/tasks/RevisionCreatedNotificationsTask.test.ts index 32d61b885..37581efad 100644 --- a/server/queues/tasks/RevisionCreatedNotificationsTask.test.ts +++ b/server/queues/tasks/RevisionCreatedNotificationsTask.test.ts @@ -6,13 +6,10 @@ import { Revision, } from "@server/models"; import { buildDocument, buildUser } from "@server/test/factories"; -import { setupTestDatabase } from "@server/test/support"; import RevisionCreatedNotificationsTask from "./RevisionCreatedNotificationsTask"; const ip = "127.0.0.1"; -setupTestDatabase(); - beforeEach(async () => { jest.resetAllMocks(); }); diff --git a/server/queues/tasks/index.ts b/server/queues/tasks/index.ts index fe94794f0..8f892964f 100644 --- a/server/queues/tasks/index.ts +++ b/server/queues/tasks/index.ts @@ -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 BaseTask from "./BaseTask"; const tasks = {}; +const rootDir = env.ENVIRONMENT === "test" ? "" : "build"; requireDirectory<{ default: BaseTask }>(__dirname).forEach( ([module, id]) => { @@ -16,7 +18,7 @@ requireDirectory<{ default: BaseTask }>(__dirname).forEach( ); glob - .sync("build/plugins/*/server/tasks/!(*.test).js") + .sync(path.join(rootDir, "plugins/*/server/tasks/!(*.test).[jt]s")) .forEach((filePath: string) => { // eslint-disable-next-line @typescript-eslint/no-var-requires const task = require(path.join(process.cwd(), filePath)).default; diff --git a/server/routes/api/auth/auth.test.ts b/server/routes/api/auth/auth.test.ts index 216084a1a..0b0b764aa 100644 --- a/server/routes/api/auth/auth.test.ts +++ b/server/routes/api/auth/auth.test.ts @@ -39,9 +39,10 @@ describe("#auth.info", () => { }, }); const body = await res.json(); + expect(res.status).toEqual(200); + const availableTeamIds = body.data.availableTeams.map((t: any) => t.id); - expect(res.status).toEqual(200); expect(availableTeamIds.length).toEqual(3); expect(availableTeamIds).toContain(team.id); expect(availableTeamIds).toContain(team2.id); diff --git a/server/routes/api/documents/documents.test.ts b/server/routes/api/documents/documents.test.ts index 7cf6c98d5..1a5ee34d6 100644 --- a/server/routes/api/documents/documents.test.ts +++ b/server/routes/api/documents/documents.test.ts @@ -1726,10 +1726,6 @@ describe("#documents.search", () => { }, }); - // setTimeout is needed here because SearchQuery is saved asynchronously - // in order to not slow down the response time. - await new Promise((resolve) => setTimeout(resolve, 100)); - const searchQuery = await SearchQuery.findAll({ where: { teamId: user.teamId, diff --git a/server/routes/api/documents/documents.ts b/server/routes/api/documents/documents.ts index 900abe247..793ec665b 100644 --- a/server/routes/api/documents/documents.ts +++ b/server/routes/api/documents/documents.ts @@ -20,7 +20,6 @@ import { ValidationError, IncorrectEditionError, } from "@server/errors"; -import Logger from "@server/logging/Logger"; import auth from "@server/middlewares/authentication"; import { rateLimiter } from "@server/middlewares/rateLimiter"; import { transaction } from "@server/middlewares/transaction"; @@ -818,15 +817,13 @@ router.post( // When requesting subsequent pages of search results we don't want to record // duplicate search query records if (offset === 0) { - void SearchQuery.create({ + await SearchQuery.create({ userId: user?.id, teamId, shareId, source: ctx.state.auth.type || "app", // we'll consider anything that isn't "api" to be "app" query, results: totalCount, - }).catch((err) => { - Logger.error("Failed to create search query", err); }); } diff --git a/server/routes/api/teams/teams.test.ts b/server/routes/api/teams/teams.test.ts index 54a97d5a1..a877cf53e 100644 --- a/server/routes/api/teams/teams.test.ts +++ b/server/routes/api/teams/teams.test.ts @@ -76,32 +76,24 @@ describe("#team.update", () => { it("should add new allowed Domains, removing empty string values", async () => { const team = await buildTeam(); const admin = await buildAdmin({ teamId: team.id }); + const domain1 = faker.internet.domainName(); + const domain2 = faker.internet.domainName(); const res = await server.post("/api/team.update", { body: { token: admin.getJwtToken(), - allowedDomains: [ - "example-company.com", - "", - "example-company.org", - "", - "", - ], + allowedDomains: [domain1, "", domain2, "", ""], }, }); const body = await res.json(); expect(res.status).toEqual(200); - expect(body.data.allowedDomains.sort()).toEqual([ - "example-company.com", - "example-company.org", - ]); + expect(body.data.allowedDomains.includes(domain1)).toBe(true); + expect(body.data.allowedDomains.includes(domain2)).toBe(true); const teamDomains: TeamDomain[] = await TeamDomain.findAll({ where: { teamId: team.id }, }); - expect(teamDomains.map((d) => d.name).sort()).toEqual([ - "example-company.com", - "example-company.org", - ]); + expect(teamDomains.map((d) => d.name).includes(domain1)).toBe(true); + expect(teamDomains.map((d) => d.name).includes(domain2)).toBe(true); }); it("should remove old allowed Domains", async () => { @@ -139,27 +131,25 @@ describe("#team.update", () => { name: faker.internet.domainName(), createdById: admin.id, }); + const domain1 = faker.internet.domainName(); + const domain2 = faker.internet.domainName(); const res = await server.post("/api/team.update", { body: { token: admin.getJwtToken(), - allowedDomains: ["example-company.org", "example-company.net"], + allowedDomains: [domain1, domain2], }, }); const body = await res.json(); expect(res.status).toEqual(200); - expect(body.data.allowedDomains.sort()).toEqual([ - "example-company.net", - "example-company.org", - ]); + expect(body.data.allowedDomains.includes(domain1)).toBe(true); + expect(body.data.allowedDomains.includes(domain2)).toBe(true); const teamDomains: TeamDomain[] = await TeamDomain.findAll({ where: { teamId: team.id }, }); - expect(teamDomains.map((d) => d.name).sort()).toEqual( - ["example-company.org", "example-company.net"].sort() - ); - + expect(teamDomains.map((d) => d.name).includes(domain1)).toBe(true); + expect(teamDomains.map((d) => d.name).includes(domain2)).toBe(true); expect(await TeamDomain.findByPk(existingTeamDomain.id)).toBeNull(); }); diff --git a/server/test/factories.ts b/server/test/factories.ts index ddf91eeb1..f4596960a 100644 --- a/server/test/factories.ts +++ b/server/test/factories.ts @@ -129,7 +129,7 @@ export function buildTeam(overrides: Record = {}) { authenticationProviders: [ { name: "slack", - providerId: uuidv4(), + providerId: uuidv4().replace(/-/g, ""), }, ], ...overrides, @@ -188,7 +188,7 @@ export async function buildUser(overrides: Partial = {}) { authentications: [ { authenticationProviderId: authenticationProvider!.id, - providerId: uuidv4(), + providerId: uuidv4().replace(/-/g, ""), }, ], ...overrides, diff --git a/server/test/globalSetup.ts b/server/test/globalSetup.ts new file mode 100644 index 000000000..e3822dcd6 --- /dev/null +++ b/server/test/globalSetup.ts @@ -0,0 +1,15 @@ +import "./env"; +import { sequelize } from "@server/storage/database"; + +module.exports = async function () { + const sql = sequelize.getQueryInterface(); + const tables = Object.keys(sequelize.models).map((model) => { + const n = sequelize.models[model].getTableName(); + return (sql.queryGenerator as any).quoteTable( + typeof n === "string" ? n : n.tableName + ); + }); + const flushQuery = `TRUNCATE ${tables.join(", ")} CASCADE`; + + await sequelize.query(flushQuery); +}; diff --git a/server/test/globalTeardown.ts b/server/test/globalTeardown.ts new file mode 100644 index 000000000..0ad2713a5 --- /dev/null +++ b/server/test/globalTeardown.ts @@ -0,0 +1,5 @@ +import { sequelize } from "@server/storage/database"; + +module.exports = async function () { + await sequelize.close(); +}; diff --git a/server/test/setup.ts b/server/test/setup.ts index 479fe4ca2..2f938276d 100644 --- a/server/test/setup.ts +++ b/server/test/setup.ts @@ -1,7 +1,5 @@ import Redis from "@server/storage/redis"; -// NOTE: this require must come after the ENV var override -// so that sequelize uses the test config variables require("@server/storage/database"); jest.mock("bull"); diff --git a/server/test/support.ts b/server/test/support.ts index 45780ca1a..75e0bbf02 100644 --- a/server/test/support.ts +++ b/server/test/support.ts @@ -17,35 +17,10 @@ export function getTestServer() { server.close(); }; - setupTestDatabase(); afterAll(server.disconnect); - return server; } -export function setupTestDatabase() { - const flush = async () => { - const sql = sequelize.getQueryInterface(); - const tables = Object.keys(sequelize.models).map((model) => { - const n = sequelize.models[model].getTableName(); - return (sql.queryGenerator as any).quoteTable( - typeof n === "string" ? n : n.tableName - ); - }); - const flushQuery = `TRUNCATE ${tables.join(", ")} CASCADE`; - - await sequelize.query(flushQuery); - }; - - const disconnect = async () => { - await sequelize.close(); - }; - - beforeAll(flush); - - afterAll(disconnect); -} - /** * Set the environment to be cloud hosted */ diff --git a/yarn.lock b/yarn.lock index 54c63cfd9..0b2ab6be8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1647,11 +1647,6 @@ dependencies: tslib "2.4.0" -"@getoutline/jest-runner-serial@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@getoutline/jest-runner-serial/-/jest-runner-serial-2.0.0.tgz#a5b7eba7e5ce198b6fef8f27a79060af6cc2ded0" - integrity sha512-sV0a/FbPuT5sf4iotQm7/GY6KtseXvlmNLEOmtXkZ9hZ0NjFzro62G8C4J/e71NJWudhQsKgrxa6Zq8G7F3mnw== - "@getoutline/y-prosemirror@^1.0.18": version "1.0.18" resolved "https://registry.yarnpkg.com/@getoutline/y-prosemirror/-/y-prosemirror-1.0.18.tgz#17245c0362d30adb85131c86fb9a59358884b234" @@ -1771,109 +1766,109 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@jest/console@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.1.tgz#b48ba7b9c34b51483e6d590f46e5837f1ab5f639" - integrity sha512-Aj772AYgwTSr5w8qnyoJ0eDYvN6bMsH3ORH1ivMotrInHLKdUz6BDlaEXHdM6kODaBIkNIyQGzsMvRdOv7VG7Q== +"@jest/console@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.6.4.tgz#a7e2d84516301f986bba0dd55af9d5fe37f46527" + integrity sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^29.6.1" - jest-util "^29.6.1" + jest-message-util "^29.6.3" + jest-util "^29.6.3" slash "^3.0.0" -"@jest/core@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.1.tgz#fac0d9ddf320490c93356ba201451825231e95f6" - integrity sha512-CcowHypRSm5oYQ1obz1wfvkjZZ2qoQlrKKvlfPwh5jUXVU12TWr2qMeH8chLMuTFzHh5a1g2yaqlqDICbr+ukQ== +"@jest/core@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.6.4.tgz#265ebee05ec1ff3567757e7a327155c8d6bdb126" + integrity sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg== dependencies: - "@jest/console" "^29.6.1" - "@jest/reporters" "^29.6.1" - "@jest/test-result" "^29.6.1" - "@jest/transform" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/console" "^29.6.4" + "@jest/reporters" "^29.6.4" + "@jest/test-result" "^29.6.4" + "@jest/transform" "^29.6.4" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^29.5.0" - jest-config "^29.6.1" - jest-haste-map "^29.6.1" - jest-message-util "^29.6.1" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.1" - jest-resolve-dependencies "^29.6.1" - jest-runner "^29.6.1" - jest-runtime "^29.6.1" - jest-snapshot "^29.6.1" - jest-util "^29.6.1" - jest-validate "^29.6.1" - jest-watcher "^29.6.1" + jest-changed-files "^29.6.3" + jest-config "^29.6.4" + jest-haste-map "^29.6.4" + jest-message-util "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.6.4" + jest-resolve-dependencies "^29.6.4" + jest-runner "^29.6.4" + jest-runtime "^29.6.4" + jest-snapshot "^29.6.4" + jest-util "^29.6.3" + jest-validate "^29.6.3" + jest-watcher "^29.6.4" micromatch "^4.0.4" - pretty-format "^29.6.1" + pretty-format "^29.6.3" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.5.0", "@jest/environment@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.1.tgz#ee358fff2f68168394b4a50f18c68278a21fe82f" - integrity sha512-RMMXx4ws+Gbvw3DfLSuo2cfQlK7IwGbpuEWXCqyYDcqYTI+9Ju3a5hDnXaxjNsa6uKh9PQF2v+qg+RLe63tz5A== +"@jest/environment@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.6.4.tgz#78ec2c9f8c8829a37616934ff4fea0c028c79f4f" + integrity sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ== dependencies: - "@jest/fake-timers" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/fake-timers" "^29.6.4" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.1" + jest-mock "^29.6.3" -"@jest/expect-utils@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.1.tgz#ab83b27a15cdd203fe5f68230ea22767d5c3acc5" - integrity sha512-o319vIf5pEMx0LmzSxxkYYxo4wrRLKHq9dP1yJU7FoPTB0LfAKSz8SWD6D/6U3v/O52t9cF5t+MeJiRsfk7zMw== +"@jest/expect-utils@^29.6.1", "@jest/expect-utils@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.6.4.tgz#17c7dfe6cec106441f218b0aff4b295f98346679" + integrity sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg== dependencies: - jest-get-type "^29.4.3" + jest-get-type "^29.6.3" -"@jest/expect@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.1.tgz#fef18265188f6a97601f1ea0a2912d81a85b4657" - integrity sha512-N5xlPrAYaRNyFgVf2s9Uyyvr795jnB6rObuPx4QFvNJz8aAjpZUDfO4bh5G/xuplMID8PrnuF1+SfSyDxhsgYg== +"@jest/expect@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.6.4.tgz#1d6ae17dc68d906776198389427ab7ce6179dba6" + integrity sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA== dependencies: - expect "^29.6.1" - jest-snapshot "^29.6.1" + expect "^29.6.4" + jest-snapshot "^29.6.4" -"@jest/fake-timers@^29.5.0", "@jest/fake-timers@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.1.tgz#c773efddbc61e1d2efcccac008139f621de57c69" - integrity sha512-RdgHgbXyosCDMVYmj7lLpUwXA4c69vcNzhrt69dJJdf8azUrpRh3ckFCaTPNjsEeRi27Cig0oKDGxy5j7hOgHg== +"@jest/fake-timers@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.6.4.tgz#45a27f093c43d5d989362a3e7a8c70c83188b4f6" + integrity sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@sinonjs/fake-timers" "^10.0.2" "@types/node" "*" - jest-message-util "^29.6.1" - jest-mock "^29.6.1" - jest-util "^29.6.1" + jest-message-util "^29.6.3" + jest-mock "^29.6.3" + jest-util "^29.6.3" -"@jest/globals@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.1.tgz#c8a8923e05efd757308082cc22893d82b8aa138f" - integrity sha512-2VjpaGy78JY9n9370H8zGRCFbYVWwjY6RdDMhoJHa1sYfwe6XM/azGN0SjY8kk7BOZApIejQ1BFPyH7FPG0w3A== +"@jest/globals@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.6.4.tgz#4f04f58731b062b44ef23036b79bdb31f40c7f63" + integrity sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA== dependencies: - "@jest/environment" "^29.6.1" - "@jest/expect" "^29.6.1" - "@jest/types" "^29.6.1" - jest-mock "^29.6.1" + "@jest/environment" "^29.6.4" + "@jest/expect" "^29.6.4" + "@jest/types" "^29.6.3" + jest-mock "^29.6.3" -"@jest/reporters@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.1.tgz#3325a89c9ead3cf97ad93df3a427549d16179863" - integrity sha512-9zuaI9QKr9JnoZtFQlw4GREQbxgmNYXU6QuWtmuODvk5nvPUeBYapVR/VYMyi2WSx3jXTLJTJji8rN6+Cm4+FA== +"@jest/reporters@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.6.4.tgz#9d6350c8a2761ece91f7946e97ab0dabc06deab7" + integrity sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.6.1" - "@jest/test-result" "^29.6.1" - "@jest/transform" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/console" "^29.6.4" + "@jest/test-result" "^29.6.4" + "@jest/transform" "^29.6.4" + "@jest/types" "^29.6.3" "@jridgewell/trace-mapping" "^0.3.18" "@types/node" "*" chalk "^4.0.0" @@ -1882,13 +1877,13 @@ glob "^7.1.3" graceful-fs "^4.2.9" istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^5.1.0" + istanbul-lib-instrument "^6.0.0" istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.6.1" - jest-util "^29.6.1" - jest-worker "^29.6.1" + jest-message-util "^29.6.3" + jest-util "^29.6.3" + jest-worker "^29.6.4" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -1901,39 +1896,39 @@ dependencies: "@sinclair/typebox" "^0.27.8" -"@jest/source-map@^29.6.0": - version "29.6.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.0.tgz#bd34a05b5737cb1a99d43e1957020ac8e5b9ddb1" - integrity sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA== +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.6.3.tgz#d90ba772095cf37a34a5eb9413f1b562a08554c4" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== dependencies: "@jridgewell/trace-mapping" "^0.3.18" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.1.tgz#850e565a3f58ee8ca6ec424db00cb0f2d83c36ba" - integrity sha512-Ynr13ZRcpX6INak0TPUukU8GWRfm/vAytE3JbJNGAvINySWYdfE7dGZMbk36oVuK4CigpbhMn8eg1dixZ7ZJOw== +"@jest/test-result@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.6.4.tgz#adf5c79f6e1fb7405ad13d67d9e2b6ff54b54c6b" + integrity sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ== dependencies: - "@jest/console" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/console" "^29.6.4" + "@jest/types" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^29.6.1": - version "29.6.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.1.tgz#e3e582ee074dd24ea9687d7d1aaf05ee3a9b068e" - integrity sha512-oBkC36PCDf/wb6dWeQIhaviU0l5u6VCsXa119yqdUosYAt7/FbQU2M2UoziO3igj/HBDEgp57ONQ3fm0v9uyyg== +"@jest/test-sequencer@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz#86aef66aaa22b181307ed06c26c82802fb836d7b" + integrity sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg== dependencies: - "@jest/test-result" "^29.6.1" + "@jest/test-result" "^29.6.4" graceful-fs "^4.2.9" - jest-haste-map "^29.6.1" + jest-haste-map "^29.6.4" slash "^3.0.0" -"@jest/transform@^29.6.1", "@jest/transform@^29.6.3": - version "29.6.3" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.3.tgz#e8e376f56fffe827b529bf03a9881e58d152c14b" - integrity sha512-dPIc3DsvMZ/S8ut4L2ViCj265mKO0owB0wfzBv2oGzL9pQ+iRvJewHqLBmsGb7XFb5UotWIEtvY5A/lnylaIoQ== +"@jest/transform@^29.6.4": + version "29.6.4" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.6.4.tgz#a6bc799ef597c5d85b2e65a11fd96b6b239bab5a" + integrity sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA== dependencies: "@babel/core" "^7.11.6" "@jest/types" "^29.6.3" @@ -1943,7 +1938,7 @@ convert-source-map "^2.0.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.3" + jest-haste-map "^29.6.4" jest-regex-util "^29.6.3" jest-util "^29.6.3" micromatch "^4.0.4" @@ -1951,7 +1946,7 @@ slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^29.5.0", "@jest/types@^29.6.1", "@jest/types@^29.6.3": +"@jest/types@^29.6.1", "@jest/types@^29.6.3": version "29.6.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== @@ -3273,11 +3268,6 @@ dependencies: "@types/express" "*" -"@types/prettier@^2.1.5": - version "2.4.2" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281" - integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA== - "@types/prismjs@*": version "1.26.0" resolved "https://registry.yarnpkg.com/@types/prismjs/-/prismjs-1.26.0.tgz#a1c3809b0ad61c62cac6d4e0c56d610c910b7654" @@ -4086,12 +4076,12 @@ babel-helper-get-function-arity@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-jest@^29.6.1, babel-jest@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.3.tgz#e62f6c38f3ec8c147244168ee18ef0b919f10348" - integrity sha512-1Ne93zZZEy5XmTa4Q+W5+zxBrDpExX8E3iy+xJJ+24ewlfo/T3qHfQJCzi/MMVFmBQDNxtRR/Gfd2dwb/0yrQw== +babel-jest@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.6.4.tgz#98dbc45d1c93319c82a8ab4a478b670655dd2585" + integrity sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw== dependencies: - "@jest/transform" "^29.6.3" + "@jest/transform" "^29.6.4" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.6.3" @@ -5629,10 +5619,10 @@ decode-uri-component@^0.2.2: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= +dedent@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" + integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== deep-equal@~1.0.1: version "1.0.1" @@ -5742,10 +5732,10 @@ diagnostics_channel@^1.1.0: resolved "https://registry.yarnpkg.com/diagnostics_channel/-/diagnostics_channel-1.1.0.tgz#bd66c49124ce3bac697dff57466464487f57cea5" integrity sha512-OE1ngLDjSBPG6Tx0YATELzYzy3RKHC+7veQ8gLa8yS7AAgw65mFbVdcsu3501abqOZCEZqZyAIemB0zXlqDSuw== -diff-sequences@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" - integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== +diff-sequences@^29.4.3, diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== dingbat-to-unicode@^1.0.1: version "1.0.1" @@ -6675,17 +6665,16 @@ exit@^0.1.2: resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^29.0.0, expect@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.1.tgz#64dd1c8f75e2c0b209418f2b8d36a07921adfdf1" - integrity sha512-XEdDLonERCU1n9uR56/Stx9OqojaLAQtZf9PrCHH9Hl8YXiEIka3H4NXJ3NOIBmQJTg7+j7buh34PMHfJujc8g== +expect@^29.0.0, expect@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.6.4.tgz#a6e6f66d4613717859b2fe3da98a739437b6f4b8" + integrity sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA== dependencies: - "@jest/expect-utils" "^29.6.1" - "@types/node" "*" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.1" - jest-message-util "^29.6.1" - jest-util "^29.6.1" + "@jest/expect-utils" "^29.6.4" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.6.4" + jest-message-util "^29.6.3" + jest-util "^29.6.3" express-useragent@^1.0.15: version "1.0.15" @@ -8240,7 +8229,7 @@ istanbul-lib-coverage@3.2.0, istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== -istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: +istanbul-lib-instrument@^5.0.4: version "5.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz#31d18bdd127f825dd02ea7bfdfd906f8ab840e9f" integrity sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A== @@ -8251,6 +8240,17 @@ istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: istanbul-lib-coverage "^3.2.0" semver "^6.3.0" +istanbul-lib-instrument@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz#7a8af094cbfff1d5bb280f62ce043695ae8dd5b8" + integrity sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" @@ -8292,139 +8292,140 @@ java-properties@^1.0.0: resolved "https://registry.yarnpkg.com/java-properties/-/java-properties-1.0.2.tgz#ccd1fa73907438a5b5c38982269d0e771fe78211" integrity sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ== -jest-changed-files@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" - integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag== +jest-changed-files@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.6.3.tgz#97cfdc93f74fb8af2a1acb0b78f836f1fb40c449" + integrity sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg== dependencies: execa "^5.0.0" + jest-util "^29.6.3" p-limit "^3.1.0" -jest-circus@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.1.tgz#861dab37e71a89907d1c0fabc54a0019738ed824" - integrity sha512-tPbYLEiBU4MYAL2XoZme/bgfUeotpDBd81lgHLCbDZZFaGmECk0b+/xejPFtmiBP87GgP/y4jplcRpbH+fgCzQ== +jest-circus@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.6.4.tgz#f074c8d795e0cc0f2ebf0705086b1be6a9a8722f" + integrity sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw== dependencies: - "@jest/environment" "^29.6.1" - "@jest/expect" "^29.6.1" - "@jest/test-result" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/environment" "^29.6.4" + "@jest/expect" "^29.6.4" + "@jest/test-result" "^29.6.4" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - dedent "^0.7.0" + dedent "^1.0.0" is-generator-fn "^2.0.0" - jest-each "^29.6.1" - jest-matcher-utils "^29.6.1" - jest-message-util "^29.6.1" - jest-runtime "^29.6.1" - jest-snapshot "^29.6.1" - jest-util "^29.6.1" + jest-each "^29.6.3" + jest-matcher-utils "^29.6.4" + jest-message-util "^29.6.3" + jest-runtime "^29.6.4" + jest-snapshot "^29.6.4" + jest-util "^29.6.3" p-limit "^3.1.0" - pretty-format "^29.6.1" + pretty-format "^29.6.3" pure-rand "^6.0.0" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.1.tgz#99d9afa7449538221c71f358f0fdd3e9c6e89f72" - integrity sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing== +jest-cli@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.6.4.tgz#ad52f2dfa1b0291de7ec7f8d7c81ac435521ede0" + integrity sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ== dependencies: - "@jest/core" "^29.6.1" - "@jest/test-result" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/core" "^29.6.4" + "@jest/test-result" "^29.6.4" + "@jest/types" "^29.6.3" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^29.6.1" - jest-util "^29.6.1" - jest-validate "^29.6.1" + jest-config "^29.6.4" + jest-util "^29.6.3" + jest-validate "^29.6.3" prompts "^2.0.1" yargs "^17.3.1" -jest-config@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.1.tgz#d785344509065d53a238224c6cdc0ed8e2f2f0dd" - integrity sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ== +jest-config@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.6.4.tgz#eff958ee41d4e1ee7a6106d02b74ad9fc427d79e" + integrity sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.6.1" - "@jest/types" "^29.6.1" - babel-jest "^29.6.1" + "@jest/test-sequencer" "^29.6.4" + "@jest/types" "^29.6.3" + babel-jest "^29.6.4" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^29.6.1" - jest-environment-node "^29.6.1" - jest-get-type "^29.4.3" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.1" - jest-runner "^29.6.1" - jest-util "^29.6.1" - jest-validate "^29.6.1" + jest-circus "^29.6.4" + jest-environment-node "^29.6.4" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.6.4" + jest-runner "^29.6.4" + jest-util "^29.6.3" + jest-validate "^29.6.3" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^29.6.1" + pretty-format "^29.6.3" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.1.tgz#13df6db0a89ee6ad93c747c75c85c70ba941e545" - integrity sha512-FsNCvinvl8oVxpNLttNQX7FAq7vR+gMDGj90tiP7siWw1UdakWUGqrylpsYrpvj908IYckm5Y0Q7azNAozU1Kg== +jest-diff@^29.6.1, jest-diff@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.6.4.tgz#85aaa6c92a79ae8cd9a54ebae8d5b6d9a513314a" + integrity sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw== dependencies: chalk "^4.0.0" - diff-sequences "^29.4.3" - jest-get-type "^29.4.3" - pretty-format "^29.6.1" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.6.3" -jest-docblock@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.4.3.tgz#90505aa89514a1c7dceeac1123df79e414636ea8" - integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg== +jest-docblock@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.6.3.tgz#293dca5188846c9f7c0c2b1bb33e5b11f21645f2" + integrity sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ== dependencies: detect-newline "^3.0.0" -jest-each@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.1.tgz#975058e5b8f55c6780beab8b6ab214921815c89c" - integrity sha512-n5eoj5eiTHpKQCAVcNTT7DRqeUmJ01hsAL0Q1SMiBHcBcvTKDELixQOGMCpqhbIuTcfC4kMfSnpmDqRgRJcLNQ== +jest-each@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.6.3.tgz#1956f14f5f0cb8ae0b2e7cabc10bb03ec817c142" + integrity sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" chalk "^4.0.0" - jest-get-type "^29.4.3" - jest-util "^29.6.1" - pretty-format "^29.6.1" + jest-get-type "^29.6.3" + jest-util "^29.6.3" + pretty-format "^29.6.3" -jest-environment-jsdom@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.5.0.tgz#cfe86ebaf1453f3297b5ff3470fbe94739c960cb" - integrity sha512-/KG8yEK4aN8ak56yFVdqFDzKNHgF4BAymCx2LbPNPsUshUlfAl0eX402Xm1pt+eoG9SLZEUVifqXtX8SK74KCw== +jest-environment-jsdom@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.6.4.tgz#0daf44454041f9e1ef7fa82eb1bd43426a82eb1c" + integrity sha512-K6wfgUJ16DoMs02JYFid9lOsqfpoVtyJxpRlnTxUHzvZWBnnh2VNGRB9EC1Cro96TQdq5TtSjb3qUjNaJP9IyA== dependencies: - "@jest/environment" "^29.5.0" - "@jest/fake-timers" "^29.5.0" - "@jest/types" "^29.5.0" + "@jest/environment" "^29.6.4" + "@jest/fake-timers" "^29.6.4" + "@jest/types" "^29.6.3" "@types/jsdom" "^20.0.0" "@types/node" "*" - jest-mock "^29.5.0" - jest-util "^29.5.0" + jest-mock "^29.6.3" + jest-util "^29.6.3" jsdom "^20.0.0" -jest-environment-node@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.1.tgz#08a122dece39e58bc388da815a2166c58b4abec6" - integrity sha512-ZNIfAiE+foBog24W+2caIldl4Irh8Lx1PUhg/GZ0odM1d/h2qORAsejiFc7zb+SEmYPn1yDZzEDSU5PmDkmVLQ== +jest-environment-node@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.4.tgz#4ce311549afd815d3cafb49e60a1e4b25f06d29f" + integrity sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ== dependencies: - "@jest/environment" "^29.6.1" - "@jest/fake-timers" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/environment" "^29.6.4" + "@jest/fake-timers" "^29.6.4" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-mock "^29.6.1" - jest-util "^29.6.1" + jest-mock "^29.6.3" + jest-util "^29.6.3" jest-fetch-mock@^3.0.3: version "3.0.3" @@ -8434,15 +8435,15 @@ jest-fetch-mock@^3.0.3: cross-fetch "^3.0.4" promise-polyfill "^8.1.3" -jest-get-type@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" - integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== - -jest-haste-map@^29.6.1, jest-haste-map@^29.6.3: +jest-get-type@^29.4.3, jest-get-type@^29.6.3: version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.3.tgz#a53ac35a137fd32d932039aab29d02a9dab30689" - integrity sha512-GecR5YavfjkhOytEFHAeI6aWWG3f/cOKNB1YJvj/B76xAmeVjy4zJUYobGF030cRmKaO1FBw3V8CZZ6KVh9ZSw== + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + +jest-haste-map@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.6.4.tgz#97143ce833829157ea7025204b08f9ace609b96a" + integrity sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog== dependencies: "@jest/types" "^29.6.3" "@types/graceful-fs" "^4.1.3" @@ -8452,170 +8453,169 @@ jest-haste-map@^29.6.1, jest-haste-map@^29.6.3: graceful-fs "^4.2.9" jest-regex-util "^29.6.3" jest-util "^29.6.3" - jest-worker "^29.6.3" + jest-worker "^29.6.4" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-leak-detector@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.1.tgz#66a902c81318e66e694df7d096a95466cb962f8e" - integrity sha512-OrxMNyZirpOEwkF3UHnIkAiZbtkBWiye+hhBweCHkVbCgyEy71Mwbb5zgeTNYWJBi1qgDVfPC1IwO9dVEeTLwQ== +jest-leak-detector@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz#b9661bc3aec8874e59aff361fa0c6d7cd507ea01" + integrity sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q== dependencies: - jest-get-type "^29.4.3" - pretty-format "^29.6.1" + jest-get-type "^29.6.3" + pretty-format "^29.6.3" -jest-matcher-utils@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.1.tgz#6c60075d84655d6300c5d5128f46531848160b53" - integrity sha512-SLaztw9d2mfQQKHmJXKM0HCbl2PPVld/t9Xa6P9sgiExijviSp7TnZZpw2Fpt+OI3nwUO/slJbOfzfUMKKC5QA== +jest-matcher-utils@^29.6.1, jest-matcher-utils@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz#327db7ababea49455df3b23e5d6109fe0c709d24" + integrity sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ== dependencies: chalk "^4.0.0" - jest-diff "^29.6.1" - jest-get-type "^29.4.3" - pretty-format "^29.6.1" + jest-diff "^29.6.4" + jest-get-type "^29.6.3" + pretty-format "^29.6.3" -jest-message-util@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.1.tgz#d0b21d87f117e1b9e165e24f245befd2ff34ff8d" - integrity sha512-KoAW2zAmNSd3Gk88uJ56qXUWbFk787QKmjjJVOjtGFmmGSZgDBrlIL4AfQw1xyMYPNVD7dNInfIbur9B2rd/wQ== +jest-message-util@^29.6.1, jest-message-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.6.3.tgz#bce16050d86801b165f20cfde34dc01d3cf85fbf" + integrity sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.6.1" + pretty-format "^29.6.3" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^29.5.0, jest-mock@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.1.tgz#049ee26aea8cbf54c764af649070910607316517" - integrity sha512-brovyV9HBkjXAEdRooaTQK42n8usKoSRR3gihzUpYeV/vwqgSoNfrksO7UfSACnPmxasO/8TmHM3w9Hp3G1dgw== +jest-mock@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.6.3.tgz#433f3fd528c8ec5a76860177484940628bdf5e0a" + integrity sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" "@types/node" "*" - jest-util "^29.6.1" + jest-util "^29.6.3" jest-pnp-resolver@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^29.4.3, jest-regex-util@^29.6.3: +jest-regex-util@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.6.3.tgz#4a556d9c776af68e1c5f48194f4d0327d24e8a52" integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== -jest-resolve-dependencies@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.1.tgz#b85b06670f987a62515bbf625d54a499e3d708f5" - integrity sha512-BbFvxLXtcldaFOhNMXmHRWx1nXQO5LoXiKSGQcA1LxxirYceZT6ch8KTE1bK3X31TNG/JbkI7OkS/ABexVahiw== +jest-resolve-dependencies@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz#20156b33c7eacbb6bb77aeba4bed0eab4a3f8734" + integrity sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA== dependencies: - jest-regex-util "^29.4.3" - jest-snapshot "^29.6.1" + jest-regex-util "^29.6.3" + jest-snapshot "^29.6.4" -jest-resolve@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.1.tgz#4c3324b993a85e300add2f8609f51b80ddea39ee" - integrity sha512-AeRkyS8g37UyJiP9w3mmI/VXU/q8l/IH52vj/cDAyScDcemRbSBhfX/NMYIGilQgSVwsjxrCHf3XJu4f+lxCMg== +jest-resolve@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.6.4.tgz#e34cb06f2178b429c38455d98d1a07572ac9faa3" + integrity sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^29.6.1" + jest-haste-map "^29.6.4" jest-pnp-resolver "^1.2.2" - jest-util "^29.6.1" - jest-validate "^29.6.1" + jest-util "^29.6.3" + jest-validate "^29.6.3" resolve "^1.20.0" resolve.exports "^2.0.0" slash "^3.0.0" -jest-runner@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.1.tgz#54557087e7972d345540d622ab5bfc3d8f34688c" - integrity sha512-tw0wb2Q9yhjAQ2w8rHRDxteryyIck7gIzQE4Reu3JuOBpGp96xWgF0nY8MDdejzrLCZKDcp8JlZrBN/EtkQvPQ== +jest-runner@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.6.4.tgz#b3b8ccb85970fde0fae40c73ee11eb75adccfacf" + integrity sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw== dependencies: - "@jest/console" "^29.6.1" - "@jest/environment" "^29.6.1" - "@jest/test-result" "^29.6.1" - "@jest/transform" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/console" "^29.6.4" + "@jest/environment" "^29.6.4" + "@jest/test-result" "^29.6.4" + "@jest/transform" "^29.6.4" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" emittery "^0.13.1" graceful-fs "^4.2.9" - jest-docblock "^29.4.3" - jest-environment-node "^29.6.1" - jest-haste-map "^29.6.1" - jest-leak-detector "^29.6.1" - jest-message-util "^29.6.1" - jest-resolve "^29.6.1" - jest-runtime "^29.6.1" - jest-util "^29.6.1" - jest-watcher "^29.6.1" - jest-worker "^29.6.1" + jest-docblock "^29.6.3" + jest-environment-node "^29.6.4" + jest-haste-map "^29.6.4" + jest-leak-detector "^29.6.3" + jest-message-util "^29.6.3" + jest-resolve "^29.6.4" + jest-runtime "^29.6.4" + jest-util "^29.6.3" + jest-watcher "^29.6.4" + jest-worker "^29.6.4" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.1.tgz#8a0fc9274ef277f3d70ba19d238e64334958a0dc" - integrity sha512-D6/AYOA+Lhs5e5il8+5pSLemjtJezUr+8zx+Sn8xlmOux3XOqx4d8l/2udBea8CRPqqrzhsKUsN/gBDE/IcaPQ== +jest-runtime@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.6.4.tgz#b0bc495c9b6b12a0a7042ac34ca9bb85f8cd0ded" + integrity sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA== dependencies: - "@jest/environment" "^29.6.1" - "@jest/fake-timers" "^29.6.1" - "@jest/globals" "^29.6.1" - "@jest/source-map" "^29.6.0" - "@jest/test-result" "^29.6.1" - "@jest/transform" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/environment" "^29.6.4" + "@jest/fake-timers" "^29.6.4" + "@jest/globals" "^29.6.4" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.6.4" + "@jest/transform" "^29.6.4" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^29.6.1" - jest-message-util "^29.6.1" - jest-mock "^29.6.1" - jest-regex-util "^29.4.3" - jest-resolve "^29.6.1" - jest-snapshot "^29.6.1" - jest-util "^29.6.1" + jest-haste-map "^29.6.4" + jest-message-util "^29.6.3" + jest-mock "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.6.4" + jest-snapshot "^29.6.4" + jest-util "^29.6.3" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.1.tgz#0d083cb7de716d5d5cdbe80d598ed2fbafac0239" - integrity sha512-G4UQE1QQ6OaCgfY+A0uR1W2AY0tGXUPQpoUClhWHq1Xdnx1H6JOrC2nH5lqnOEqaDgbHFgIwZ7bNq24HpB180A== +jest-snapshot@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.4.tgz#9833eb6b66ff1541c7fd8ceaa42d541f407b4876" + integrity sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.6.1" - "@jest/transform" "^29.6.1" - "@jest/types" "^29.6.1" - "@types/prettier" "^2.1.5" + "@jest/expect-utils" "^29.6.4" + "@jest/transform" "^29.6.4" + "@jest/types" "^29.6.3" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^29.6.1" + expect "^29.6.4" graceful-fs "^4.2.9" - jest-diff "^29.6.1" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.6.1" - jest-message-util "^29.6.1" - jest-util "^29.6.1" + jest-diff "^29.6.4" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.6.4" + jest-message-util "^29.6.3" + jest-util "^29.6.3" natural-compare "^1.4.0" - pretty-format "^29.6.1" + pretty-format "^29.6.3" semver "^7.5.3" -jest-util@^29.5.0, jest-util@^29.6.1, jest-util@^29.6.3: +jest-util@^29.6.1, jest-util@^29.6.3: version "29.6.3" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.3.tgz#e15c3eac8716440d1ed076f09bc63ace1aebca63" integrity sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA== @@ -8627,30 +8627,30 @@ jest-util@^29.5.0, jest-util@^29.6.1, jest-util@^29.6.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.1.tgz#765e684af6e2c86dce950aebefbbcd4546d69f7b" - integrity sha512-r3Ds69/0KCN4vx4sYAbGL1EVpZ7MSS0vLmd3gV78O+NAx3PDQQukRU5hNHPXlyqCgFY8XUk7EuTMLugh0KzahA== +jest-validate@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.6.3.tgz#a75fca774cfb1c5758c70d035d30a1f9c2784b4d" + integrity sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg== dependencies: - "@jest/types" "^29.6.1" + "@jest/types" "^29.6.3" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^29.4.3" + jest-get-type "^29.6.3" leven "^3.1.0" - pretty-format "^29.6.1" + pretty-format "^29.6.3" -jest-watcher@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.1.tgz#7c0c43ddd52418af134c551c92c9ea31e5ec942e" - integrity sha512-d4wpjWTS7HEZPaaj8m36QiaP856JthRZkrgcIY/7ISoUWPIillrXM23WPboZVLbiwZBt4/qn2Jke84Sla6JhFA== +jest-watcher@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.6.4.tgz#633eb515ae284aa67fd6831f1c9d1b534cf0e0ba" + integrity sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ== dependencies: - "@jest/test-result" "^29.6.1" - "@jest/types" "^29.6.1" + "@jest/test-result" "^29.6.4" + "@jest/types" "^29.6.3" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.13.1" - jest-util "^29.6.1" + jest-util "^29.6.3" string-length "^4.0.1" jest-worker@^26.2.1: @@ -8662,10 +8662,10 @@ jest-worker@^26.2.1: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^29.6.1, jest-worker@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.3.tgz#7b1a47bbb6559f3c0882d16595938590e63915d5" - integrity sha512-wacANXecZ/GbQakpf2CClrqrlwsYYDSXFd4fIGdL+dXpM2GWoJ+6bhQ7vR3TKi3+gkSfBkjy1/khH/WrYS4Q6g== +jest-worker@^29.6.4: + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.4.tgz#f34279f4afc33c872b470d4af21b281ac616abd3" + integrity sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q== dependencies: "@types/node" "*" jest-util "^29.6.3" @@ -10673,12 +10673,12 @@ pretty-bytes@^6.0.0: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-6.1.0.tgz#1d1cc9aae1939012c74180b679da6684616bf804" integrity sha512-Rk753HI8f4uivXi4ZCIYdhmG1V+WKzvRMg/X+M42a6t7D07RcmopXJMDNk6N++7Bl75URRGsb40ruvg7Hcp2wQ== -pretty-format@^29.0.0, pretty-format@^29.6.1: - version "29.6.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.1.tgz#ec838c288850b7c4f9090b867c2d4f4edbfb0f3e" - integrity sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog== +pretty-format@^29.0.0, pretty-format@^29.6.1, pretty-format@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.6.3.tgz#d432bb4f1ca6f9463410c3fb25a0ba88e594ace7" + integrity sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw== dependencies: - "@jest/schemas" "^29.6.0" + "@jest/schemas" "^29.6.3" ansi-styles "^5.0.0" react-is "^18.0.0"