Initial commit: DashCaddy v1.0
Full codebase including API server (32 modules + routes), dashboard frontend, DashCA certificate distribution, installer script, and deployment skills.
This commit is contained in:
21
dashcaddy-api/__tests__/jest.setup.js
Normal file
21
dashcaddy-api/__tests__/jest.setup.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
// Use temp directory for all file-based operations during tests
|
||||
const tmpDir = path.join(os.tmpdir(), 'dashcaddy-tests');
|
||||
|
||||
// Prevent modules from touching production files
|
||||
process.env.ENCRYPTION_KEY_FILE = path.join(tmpDir, '.encryption-key');
|
||||
process.env.DASHCADDY_ENCRYPTION_KEY = 'a'.repeat(64); // 32 bytes in hex for test determinism
|
||||
|
||||
// Suppress console output during tests (set DEBUG_TESTS=1 to enable)
|
||||
if (!process.env.DEBUG_TESTS) {
|
||||
global.console = {
|
||||
...console,
|
||||
log: jest.fn(),
|
||||
warn: jest.fn(),
|
||||
error: jest.fn(),
|
||||
info: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user