Files
obsidian_ollama/__mocks__/obsidian.ts
T
2026-05-04 22:05:10 +02:00

51 lines
854 B
TypeScript

// Enhanced Obsidian mock for testing
export class Vault {
getMarkdownFiles() {
return [];
}
async read(file: any) {
return '';
}
async create(path: string, content: string) {
return null;
}
}
export class Workspace {
getLeaf() {
return {
setViewState: jest.fn(),
};
}
}
export class App {
vault = new Vault();
workspace = new Workspace();
}
export class ItemView {
contentEl: HTMLElement = document.createElement('div');
app: App;
constructor() {
this.app = new App();
}
}
export class Notice {
static create(message: string) {}
}
// Mock types for DOM elements
export type TFile = {
basename: string;
};
// Export additional types that might be used in tests
export const Plugin: any = jest.fn();
export const WorkspaceLeaf: any = jest.fn();
export const Setting: any = jest.fn();