-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix config path handling in test environment
Co-Authored-By: Michael Latman <[email protected]>
- Loading branch information
1 parent
3b04d9b
commit 86bb6e7
Showing
3 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { jest } from '@jest/globals'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
// Set NODE_ENV to 'test' | ||
process.env.NODE_ENV = 'test'; | ||
|
||
// Ensure test directory exists | ||
const testConfigDir = path.dirname('/tmp/test-mcp-config.json'); | ||
if (!fs.existsSync(testConfigDir)) { | ||
fs.mkdirSync(testConfigDir, { recursive: true }); | ||
} | ||
|
||
// Mock console.error to keep test output clean | ||
console.error = jest.fn(); |