From a2af5b23a3a7728babf191a10c57b4754768e8e6 Mon Sep 17 00:00:00 2001 From: Christopher Hase Date: Mon, 31 Mar 2025 14:36:26 +0200 Subject: [PATCH] unit tests part 4 --- broker.test.ts | 1 - broker.ts | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/broker.test.ts b/broker.test.ts index f9f75de..084d2c7 100644 --- a/broker.test.ts +++ b/broker.test.ts @@ -1,5 +1,4 @@ import { html } from "./broker"; -//import { test } from 'jest'; import { test, beforeAll, afterAll } from "@jest/globals"; beforeAll(() => { diff --git a/broker.ts b/broker.ts index f48791b..0c63e4f 100644 --- a/broker.ts +++ b/broker.ts @@ -71,14 +71,11 @@ async function sendEmail(content: string) { // Create Transporter const transporter = nodemailer.createTransport({ - //host: "mailhog.mailhog.svc.cluster.local", // MailHog ClusterIP host: config.mailHost, - //port: 1025, // Standard-MailHog SMTP-Port port: config.mailPort, secure: false // MailHog needs no encryption }); - try { const info = await transporter.sendMail({ from: '"The Oracle" ', @@ -97,7 +94,7 @@ async function sendEmail(content: string) { //Calculate the time for the next execution of the main process, depending on configuration. //Returns the time of the next process loop. function calculateNextRunDate(daysInterval: number, timeOfDay: string): Date { - const currentDate = new Date(); + /*const currentDate = new Date(); // Splitte die Uhrzeit in Stunden und Minuten const [hours, minutes] = timeOfDay.split(':').map(Number); @@ -113,11 +110,12 @@ function calculateNextRunDate(daysInterval: number, timeOfDay: string): Date { // Berechne das Datum für den nächsten Ausführungszeitpunkt unter Berücksichtigung von X Tagen currentDate.setDate(currentDate.getDate() + daysInterval); - return currentDate; + return currentDate;*/ //TODO: JUST FOR DEBUGGING!!! - /*currentDate.setMinutes(currentDate.getMinutes() + 2); - return currentDate;*/ + const currentDate = new Date(); + currentDate.setMinutes(currentDate.getMinutes() + 2); + return currentDate; } //Schedule the next process loop.