fix(core): update

This commit is contained in:
Philipp Kunz 2020-08-12 15:09:41 +00:00
parent a9ed0370fd
commit 290b09623f
4 changed files with 16 additions and 19 deletions

View File

@ -9,8 +9,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild)", "build": "(tsbuild --web)"
"format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.0.22", "@gitzone/tsbuild": "^2.0.22",
@ -41,4 +40,4 @@
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
] ]
} }

View File

@ -17,13 +17,15 @@ tap.test('should create a valid instance of Smartsmtp', async () => {
expect(testSmartsmtp).to.be.instanceOf(smartsmtp.Smartsmtp); expect(testSmartsmtp).to.be.instanceOf(smartsmtp.Smartsmtp);
}); });
tap.test('should send a message', async () => { tap.test('should send a message', async () => {
const result = await testSmartsmtp.sendSmartMail(new smartmail.Smartmail({ const result = await testSmartsmtp.sendSmartMail(
body: '', new smartmail.Smartmail({
from: 'smartsmtp@mail.lossless.one', body: '',
subject: 'this is a test message', from: 'smartsmtp@mail.lossless.one',
}), 'sandbox@mail.git.zone'); subject: 'this is a test message',
}),
'sandbox@mail.git.zone'
);
console.log(result); console.log(result);
}); });

View File

@ -18,8 +18,8 @@ export class Smartsmtp {
secure: true, // upgrade later with STARTTLS secure: true, // upgrade later with STARTTLS
auth: { auth: {
user: optionsArg.smtpUser, user: optionsArg.smtpUser,
pass: optionsArg.smtpPassword pass: optionsArg.smtpPassword,
} },
}); });
} }
@ -36,9 +36,9 @@ export class Smartsmtp {
to: toArg, to: toArg,
subject: smartmailArg.getSubject(dataArg), subject: smartmailArg.getSubject(dataArg),
text: smartmailArg.getBody(dataArg), text: smartmailArg.getBody(dataArg),
html: smartmailArg.getBody(dataArg) html: smartmailArg.getBody(dataArg),
}; };
const response = await this.nodemailerTransport.sendMail(message); const response = await this.nodemailerTransport.sendMail(message);
return response; return response;
} }
} }

View File

@ -1,13 +1,9 @@
// @pushrocks scope // @pushrocks scope
import * as smartmail from '@pushrocks/smartmail'; import * as smartmail from '@pushrocks/smartmail';
export { export { smartmail };
smartmail
};
// third party scope // third party scope
import * as nodemailer from 'nodemailer'; import * as nodemailer from 'nodemailer';
export { export { nodemailer };
nodemailer
};