mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
This commit refactors the handling of ALLOWED_ROOT_DIRECTORY by removing legacy support for ALLOWED_PROJECT_DIRS and simplifying the security logic. Key changes include: - Removed deprecated ALLOWED_PROJECT_DIRS references from .env.example and security.ts. - Updated initAllowedPaths() to focus solely on ALLOWED_ROOT_DIRECTORY and DATA_DIR. - Enhanced logging for ALLOWED_ROOT_DIRECTORY configuration status. - Adjusted route handlers to utilize the new workspace directory logic. - Introduced a centralized storage module for localStorage operations to improve consistency and error handling. These changes aim to enhance security and maintainability by consolidating directory management into a single variable. Tests: All unit tests passing.
16 lines
297 B
TypeScript
16 lines
297 B
TypeScript
/**
|
|
* Vitest global setup file
|
|
* Runs before each test file
|
|
*/
|
|
|
|
import { vi, beforeEach } from "vitest";
|
|
|
|
// Set test environment variables
|
|
process.env.NODE_ENV = "test";
|
|
process.env.DATA_DIR = "/tmp/test-data";
|
|
|
|
// Reset all mocks before each test
|
|
beforeEach(() => {
|
|
vi.clearAllMocks();
|
|
});
|