MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / createApp

Function createApp

tests/unit/modals/taskModalProjects.test.ts:30–47  ·  view source on GitHub ↗
(files: Record<string, TFile> = {})

Source from the content-addressed store, hash-verified

28}
29
30function createApp(files: Record<string, TFile> = {}): any {
31 return {
32 metadataCache: {
33 fileToLinktext: (targetFile: TFile) => targetFile.path.replace(/\.md$/i, ""),
34 getFirstLinkpathDest: (linkPath: string) =>
35 files[linkPath] ?? files[`${linkPath}.md`] ?? null,
36 getCache: () => ({}),
37 },
38 workspace: {
39 getLeaf: () => ({ openFile: jest.fn() }),
40 openLinkText: jest.fn(),
41 trigger: jest.fn(),
42 },
43 fileManager: {
44 generateMarkdownLink: (targetFile: TFile) => `[${targetFile.basename}](${targetFile.path})`,
45 },
46 };
47}
48
49describe("taskModalProjects", () => {
50 it("creates project items from selected files", () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected