Initial commit of n8n MCP Server
A Model Context Protocol (MCP) server that integrates with n8n, providing tools for workflow and execution management via the n8n API.
This commit is contained in:
33
tests/test-setup.ts
Normal file
33
tests/test-setup.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Global test setup for n8n MCP Server tests
|
||||
*/
|
||||
import { beforeEach, afterEach, jest } from '@jest/globals';
|
||||
|
||||
// Reset environment variables before each test
|
||||
beforeEach(() => {
|
||||
process.env = {
|
||||
...process.env,
|
||||
NODE_ENV: 'test'
|
||||
};
|
||||
});
|
||||
|
||||
// Clean up after each test
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
export const mockEnv = (envVars: Record<string, string>) => {
|
||||
const originalEnv = process.env;
|
||||
|
||||
beforeEach(() => {
|
||||
process.env = {
|
||||
...originalEnv,
|
||||
...envVars
|
||||
};
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
process.env = originalEnv;
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user