(plugin: QuickAdd, existingPath: string)
| 283 | }); |
| 284 | |
| 285 | function withTemplateFile(plugin: QuickAdd, existingPath: string) { |
| 286 | (plugin as unknown as { app: unknown }).app = { |
| 287 | vault: { |
| 288 | getAbstractFileByPath: vi.fn((path: string) => { |
| 289 | if (path !== existingPath) return null; |
| 290 | const file = new TFile(); |
| 291 | file.path = path; |
| 292 | return file; |
| 293 | }), |
| 294 | }, |
| 295 | }; |
| 296 | } |
| 297 | |
| 298 | it("returns an error when run-template is given no path", async () => { |
| 299 | const { plugin, handlers } = createPlugin([]); |
no test coverage detected