unit tests part 4
This commit is contained in:
parent
323cea883d
commit
a2af5b23a3
2 changed files with 5 additions and 8 deletions
|
@ -1,5 +1,4 @@
|
||||||
import { html } from "./broker";
|
import { html } from "./broker";
|
||||||
//import { test } from 'jest';
|
|
||||||
import { test, beforeAll, afterAll } from "@jest/globals";
|
import { test, beforeAll, afterAll } from "@jest/globals";
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|
12
broker.ts
12
broker.ts
|
@ -71,14 +71,11 @@ async function sendEmail(content: string) {
|
||||||
|
|
||||||
// Create Transporter
|
// Create Transporter
|
||||||
const transporter = nodemailer.createTransport({
|
const transporter = nodemailer.createTransport({
|
||||||
//host: "mailhog.mailhog.svc.cluster.local", // MailHog ClusterIP
|
|
||||||
host: config.mailHost,
|
host: config.mailHost,
|
||||||
//port: 1025, // Standard-MailHog SMTP-Port
|
|
||||||
port: config.mailPort,
|
port: config.mailPort,
|
||||||
secure: false // MailHog needs no encryption
|
secure: false // MailHog needs no encryption
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const info = await transporter.sendMail({
|
const info = await transporter.sendMail({
|
||||||
from: '"The Oracle" <the.oracle@holy.mountain>',
|
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.
|
//Calculate the time for the next execution of the main process, depending on configuration.
|
||||||
//Returns the time of the next process loop.
|
//Returns the time of the next process loop.
|
||||||
function calculateNextRunDate(daysInterval: number, timeOfDay: string): Date {
|
function calculateNextRunDate(daysInterval: number, timeOfDay: string): Date {
|
||||||
const currentDate = new Date();
|
/*const currentDate = new Date();
|
||||||
|
|
||||||
// Splitte die Uhrzeit in Stunden und Minuten
|
// Splitte die Uhrzeit in Stunden und Minuten
|
||||||
const [hours, minutes] = timeOfDay.split(':').map(Number);
|
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
|
// Berechne das Datum für den nächsten Ausführungszeitpunkt unter Berücksichtigung von X Tagen
|
||||||
currentDate.setDate(currentDate.getDate() + daysInterval);
|
currentDate.setDate(currentDate.getDate() + daysInterval);
|
||||||
|
|
||||||
return currentDate;
|
return currentDate;*/
|
||||||
|
|
||||||
//TODO: JUST FOR DEBUGGING!!!
|
//TODO: JUST FOR DEBUGGING!!!
|
||||||
/*currentDate.setMinutes(currentDate.getMinutes() + 2);
|
const currentDate = new Date();
|
||||||
return currentDate;*/
|
currentDate.setMinutes(currentDate.getMinutes() + 2);
|
||||||
|
return currentDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Schedule the next process loop.
|
//Schedule the next process loop.
|
||||||
|
|
Loading…
Reference in a new issue