- Create dedicated ProfanityFilter class with isolated SQLite database - Separate profanity.db from main application database to prevent SQLITE_MISUSE errors - Add comprehensive custom word management (CRUD operations) - Implement advanced profanity detection with leetspeak and pattern matching - Add admin UI for managing custom profanity words - Add extensive test suites for both profanity filter and API routes - Update server.js to use isolated profanity filter - Add proper database initialization and cleanup methods - Support in-memory databases for testing Breaking changes: - Profanity filter now uses separate database file - Updated admin API endpoints for profanity management - Enhanced profanity detection capabilities
16 lines
408 B
JavaScript
16 lines
408 B
JavaScript
// Test setup file for Jest
|
|
// This file runs before each test suite
|
|
|
|
// Suppress console.log during tests unless debugging
|
|
if (!process.env.DEBUG_TESTS) {
|
|
console.log = jest.fn();
|
|
console.warn = jest.fn();
|
|
console.error = jest.fn();
|
|
}
|
|
|
|
// Set test environment variables
|
|
process.env.NODE_ENV = 'test';
|
|
process.env.ADMIN_PASSWORD = 'test_admin_password';
|
|
|
|
// Global test timeout
|
|
jest.setTimeout(30000);
|