Skip to content

Commit 20bcdae

Browse files
committed
test(api-headless-cms-bulk-actions): convert to vitest
1 parent 769ca30 commit 20bcdae

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

packages/api-headless-cms-bulk-actions/__tests__/tasks/createBulkAction.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { jest } from "@jest/globals";
1+
import { describe, it, expect, beforeEach, vi } from "vitest";
22
import { IntrospectionField, IntrospectionInterfaceType } from "graphql";
33
import { useGraphQlHandler } from "~tests/context/useGraphQLHandler";
44
import { createBulkAction } from "~/plugins";
@@ -75,8 +75,8 @@ describe("createBulkAction", () => {
7575
});
7676

7777
it("should update the ENUMS when a new bulk action is created, only for the provided `modelIds`", async () => {
78-
const dataLoader = jest.fn();
79-
const dataProcessor = jest.fn();
78+
const dataLoader = vi.fn();
79+
const dataProcessor = vi.fn();
8080

8181
const { introspect } = useGraphQlHandler({
8282
plugins: [

packages/api-headless-cms-bulk-actions/jest.setup.js

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { createTestConfig } from "../../testing";
2+
3+
export default async () => {
4+
const { getPresets } = await import("@webiny/project-utils/testing/presets/index.js");
5+
const presets = await getPresets(
6+
["@webiny/api-admin-users", "storage-operations"],
7+
["@webiny/api-headless-cms", "storage-operations"],
8+
["@webiny/api-i18n", "storage-operations"],
9+
["@webiny/api-security", "storage-operations"],
10+
["@webiny/api-tenancy", "storage-operations"]
11+
);
12+
13+
return createTestConfig({ path: import.meta.dirname, presets });
14+
};

0 commit comments

Comments
 (0)