mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
test: register test for CleanEmailService
This commit is contained in:
parent
054b9c2864
commit
2c3065a70f
@ -243,6 +243,9 @@ const install = async ({ services, app, useapi }) => {
|
|||||||
const { EdgeRateLimitService } = require('./services/abuse-prevention/EdgeRateLimitService');
|
const { EdgeRateLimitService } = require('./services/abuse-prevention/EdgeRateLimitService');
|
||||||
services.registerService('edge-rate-limit', EdgeRateLimitService);
|
services.registerService('edge-rate-limit', EdgeRateLimitService);
|
||||||
|
|
||||||
|
const { CleanEmailService } = require('./services/CleanEmailService');
|
||||||
|
services.registerService('clean-email', CleanEmailService);
|
||||||
|
|
||||||
const { Emailservice } = require('./services/EmailService');
|
const { Emailservice } = require('./services/EmailService');
|
||||||
services.registerService('email', Emailservice);
|
services.registerService('email', Emailservice);
|
||||||
|
|
||||||
|
@ -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);
|
ins._test(testapi);
|
||||||
|
|
||||||
total_passed += passed;
|
total_passed += passed;
|
||||||
|
Loading…
Reference in New Issue
Block a user