unit tests part 4
All checks were successful
ci / build (push) Successful in 1m14s

This commit is contained in:
Christopher Hase 2025-03-31 14:36:26 +02:00
parent 323cea883d
commit a2af5b23a3
2 changed files with 5 additions and 8 deletions

View file

@ -1,5 +1,4 @@
import { html } from "./broker";
//import { test } from 'jest';
import { test, beforeAll, afterAll } from "@jest/globals";
beforeAll(() => {

View file

@ -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" <the.oracle@holy.mountain>',
@ -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.