mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-10-29 02:44:12 +00:00
replace bent by native node fetch (#401)
* replace bent by native node fetch * wip * wip * wip
This commit is contained in:
1 parent
b05b32d73e
commit
ffda2398f4
41 files changed
+678
-667
No files matched your search
+1
-3
@@ -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>');
|
||||
|
||||
Reference in new issue
Block a user