MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / createApp

Function createApp

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

Source from the content-addressed store, hash-verified

31}
32
33function createApp(files: Record<string, TFile> = {}): any {
34 return {
35 metadataCache: {
36 fileToLinktext: (targetFile: TFile) => targetFile.path.replace(/\.md$/i, ""),
37 getFirstLinkpathDest: (linkPath: string) =>
38 files[linkPath] ?? files[`${linkPath}.md`] ?? null,
39 getCache: () => ({}),
40 },
41 workspace: {
42 getLeaf: () => ({ openFile: jest.fn() }),
43 openLinkText: jest.fn(),
44 trigger: jest.fn(),
45 },
46 fileManager: {
47 generateMarkdownLink: (targetFile: TFile) => `[${targetFile.basename}](${targetFile.path})`,
48 },
49 };
50}
51
52describe("taskModalSubtasks", () => {
53 it("filters out the current task and already selected subtasks", () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected