feat: add email-server-worker with clean template architecture
Add new email-server-worker project implementing a self-scheduling background worker pattern with HTTP monitoring. Removed all business-specific code from copied source, creating a clean, reusable template. Key features: - Self-scheduling worker loop with configurable interval - Graceful shutdown support (Docker-compatible) - Prometheus metrics collection - Health check endpoints (/healthcheck, /metrics, /ping) - Example worker template for easy customization - Comprehensive architecture documentation in CLAUDE.md The worker is now ready for email server implementation with no external dependencies on Evolution/MSSQL/ElasticSearch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
39
email-server-worker/jest.config.ts
Normal file
39
email-server-worker/jest.config.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/** @type {import('jest/dist/types').InitialOptionsTsJest} */
|
||||
|
||||
import type { Config } from 'jest/build/index';
|
||||
|
||||
const config:Config = {
|
||||
// preset: 'ts-jest',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': [
|
||||
'esbuild-jest', {
|
||||
sourcemap:true, // bez ovog VS code umjesto originala prikazuje transpilirane datoteke
|
||||
target:'es2020' // ovo je nužno kako bi BigInt funkcionirao
|
||||
}]
|
||||
},
|
||||
maxWorkers: 4,
|
||||
testEnvironment: 'node',
|
||||
// The root directory that Jest should scan for tests and modules within
|
||||
rootDir: "./",
|
||||
// A list of paths to directories that Jest should use to search for files in
|
||||
roots: [
|
||||
"<rootDir>/tests",
|
||||
],
|
||||
// The glob patterns Jest uses to detect test files
|
||||
testMatch: [
|
||||
"**/?(*.)+(spec).[tj]s?(x)",
|
||||
],
|
||||
// Automatically clear mock calls and instances between every test
|
||||
clearMocks: true,
|
||||
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
||||
transformIgnorePatterns: ["/node_modules/"],
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
testPathIgnorePatterns: ["/node_modules/", "/build/"],
|
||||
// Indicates whether each individual test should be reported during the run
|
||||
verbose: true,
|
||||
setupFiles: [
|
||||
'dotenv/config', // učitaj varijable iz .env i učini ih dostupne testiranom software-u
|
||||
]
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
Reference in New Issue
Block a user