fix: Mock fs module in tests to prevent certificate directory creation (v0.9.0a)

This commit is contained in:
Aaron Bockelie 2025-08-12 10:52:39 -05:00
parent 404bda1397
commit 7d196cd39b
No known key found for this signature in database
GPG key ID: BA464FC9847A832A
2 changed files with 9 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "obsidian-mcp-plugin",
"version": "0.9.0",
"version": "0.9.0a",
"description": "Semantic MCP server plugin providing AI tools with direct Obsidian vault access via HTTP transport",
"main": "main.js",
"scripts": {

View file

@ -1,6 +1,14 @@
import { MCPHttpServer } from '../src/mcp-server';
import { App } from 'obsidian';
// Mock the fs module to prevent file system operations in tests
jest.mock('fs', () => ({
existsSync: jest.fn(() => false),
mkdirSync: jest.fn(),
readFileSync: jest.fn(),
writeFileSync: jest.fn()
}));
describe('MCPHttpServer', () => {
let mockApp: App;