From 2c3065a70f7d67eea7ebe372743fc42b131e16f3 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Wed, 2 Oct 2024 21:30:14 -0400 Subject: [PATCH] test: register test for CleanEmailService --- src/backend/src/CoreModule.js | 3 +++ src/backend/tools/test.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/backend/src/CoreModule.js b/src/backend/src/CoreModule.js index 6f3dc243..67a05030 100644 --- a/src/backend/src/CoreModule.js +++ b/src/backend/src/CoreModule.js @@ -243,6 +243,9 @@ const install = async ({ services, app, useapi }) => { const { EdgeRateLimitService } = require('./services/abuse-prevention/EdgeRateLimitService'); services.registerService('edge-rate-limit', EdgeRateLimitService); + const { CleanEmailService } = require('./services/CleanEmailService'); + services.registerService('clean-email', CleanEmailService); + const { Emailservice } = require('./services/EmailService'); services.registerService('email', Emailservice); diff --git a/src/backend/tools/test.js b/src/backend/tools/test.js index f1f03773..f04b7554 100644 --- a/src/backend/tools/test.js +++ b/src/backend/tools/test.js @@ -157,6 +157,21 @@ for ( const name in k.services.instances_ ) { } }; + testapi.assert.equal = (a, b, name) => { + name = name || `${a} === ${b}`; + if ( a === b ) { + passed++; + repeat_after(() => console.log(`\x1B[32;1m ✔ ${name}\x1B[0m`)); + } else { + failed++; + repeat_after(() => { + console.log(`\x1B[31;1m ✘ ${name}\x1B[0m`); + console.log(`\x1B[31;1m Expected: ${b}\x1B[0m`); + console.log(`\x1B[31;1m Got: ${a}\x1B[0m`); + }); + } + }; + ins._test(testapi); total_passed += passed;