Skip to content

Commit 39cc667

Browse files
committed
update test
1 parent b373956 commit 39cc667

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/unit/accessListUtils.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
/* global jest */
1+
import { describe, it, expect, vi } from "vitest";
22
import { ApiClient } from "../../src/common/atlas/apiClient.js";
33
import { ensureCurrentIpInAccessList } from "../../src/common/atlas/accessListUtils.js";
4-
import { jest } from "@jest/globals";
54
import { ApiClientError } from "../../src/common/atlas/apiClientError.js";
65

76
describe("accessListUtils", () => {
87
it("should add the current IP to the access list", async () => {
98
const apiClient = {
10-
getIpInfo: jest.fn().mockResolvedValue({ currentIpv4Address: "127.0.0.1" } as never),
11-
createProjectIpAccessList: jest.fn().mockResolvedValue(undefined as never),
9+
getIpInfo: vi.fn().mockResolvedValue({ currentIpv4Address: "127.0.0.1" } as never),
10+
createProjectIpAccessList: vi.fn().mockResolvedValue(undefined as never),
1211
} as unknown as ApiClient;
1312
await ensureCurrentIpInAccessList(apiClient, "projectId");
1413
expect(apiClient.createProjectIpAccessList).toHaveBeenCalledWith({
@@ -21,8 +20,8 @@ describe("accessListUtils", () => {
2120

2221
it("should not fail if the current IP is already in the access list", async () => {
2322
const apiClient = {
24-
getIpInfo: jest.fn().mockResolvedValue({ currentIpv4Address: "127.0.0.1" } as never),
25-
createProjectIpAccessList: jest
23+
getIpInfo: vi.fn().mockResolvedValue({ currentIpv4Address: "127.0.0.1" } as never),
24+
createProjectIpAccessList: vi
2625
.fn()
2726
.mockRejectedValue(
2827
ApiClientError.fromError(

0 commit comments

Comments
 (0)