replace bent by native node fetch (#401)

* replace bent by native node fetch

* wip

* wip

* wip
This commit is contained in:
Hoan Luu Huu authored and GitHub committed 2025-04-24 06:50:15 -04:00
1 parent b05b32d73e
commit ffda2398f4
41 files changed
+678 -667

No files matched your search

+1 -3
View File
@@ -1,7 +1,5 @@
const test = require('tape');
const {emailSimpleText} = require('../lib/utils/email-utils');
const bent = require('bent');
const getJSON = bent('json')
const logger = {
debug: () =>{},
info: () => {}
@@ -15,7 +13,7 @@ test('email-test', async(t) => {
await emailSimpleText(logger, 'test@gmail.com', 'subject', 'body text');
const obj = await getJSON(`http://127.0.0.1:3101/lastRequest/custom_email_vendor`);
const obj = await (await fetch(`http://127.0.0.1:3101/lastRequest/custom_email_vendor`)).json();
t.ok(obj.headers['Content-Type'] == 'application/json');
t.ok(obj.headers.Authorization == 'Basic VVNFUk5BTUU6UEFTU1dPUkQ=');
t.ok(obj.body.from == 'jambonz Support <support@jambonz.org>');