-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sort out mocking file access methods
- Loading branch information
1 parent
11022d8
commit f31ec4c
Showing
6 changed files
with
28 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { v4 as uuidv4 } from "uuid"; | ||
import * as RecentDirectoryEntry from "../services/database/RecentDirectoryEntry"; | ||
import FileManager from "../services/fileManager/FileManager"; | ||
|
||
export const mockOpenDirectoryDialog = (selectedDirectoryName: string) => | ||
jest | ||
.spyOn(FileManager, "openDirectoryDialogHandleCancel") | ||
.mockImplementation(() => Promise.resolve({ name: selectedDirectoryName }) as any); | ||
|
||
export const mockGetWorkingDirectory = () => | ||
jest.spyOn(RecentDirectoryEntry, "getWorkingDirectory").mockImplementation(() => | ||
Promise.resolve({ | ||
id: uuidv4(), | ||
type: RecentDirectoryEntry.RecentDirectoryType.WORKING_DIRECTORY, | ||
friendlyName: "My Working Directory", | ||
handle: { | ||
name: "working-directory", | ||
getDirectoryHandle: () => ({ name: "project-directory" }), | ||
} as any, | ||
}) | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters