Skip to content

Commit

Permalink
test: update Firefox cookie discovery tests to use fast-glob
Browse files Browse the repository at this point in the history
  • Loading branch information
mherod committed Jan 4, 2025
1 parent 046cce9 commit a1421d4
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { FirefoxCookieQueryStrategy } from "../FirefoxCookieQueryStrategy";

// Mock the glob sync function
jest.mock("glob", () => ({
// Mock fast-glob
jest.mock("fast-glob", () => ({
sync: jest.fn(),
}));

interface MockGlob {
interface MockFastGlob {
sync: jest.Mock;
}

Expand All @@ -24,7 +24,7 @@ describe("FirefoxCookieQueryStrategy - File Discovery", () => {
});

it("should find cookie files in macOS paths", async () => {
const { sync } = jest.requireMock<MockGlob>("glob");
const { sync } = jest.requireMock<MockFastGlob>("fast-glob");
sync.mockImplementation((pattern: string) => {
if (pattern.includes("Library/Application Support/Firefox")) {
return [
Expand All @@ -43,7 +43,7 @@ describe("FirefoxCookieQueryStrategy - File Discovery", () => {
});

it("should find cookie files in Linux paths", async () => {
const { sync } = jest.requireMock<MockGlob>("glob");
const { sync } = jest.requireMock<MockFastGlob>("fast-glob");
sync.mockImplementation((pattern: string) => {
if (pattern.includes(".mozilla/firefox")) {
return ["/mock/home/.mozilla/firefox/xyz789/cookies.sqlite"];
Expand Down

0 comments on commit a1421d4

Please sign in to comment.