Skip to content

Commit

Permalink
Create Mail Test Unit
Browse files Browse the repository at this point in the history
  • Loading branch information
a632079 committed Jan 29, 2018
1 parent e38461b commit f5037fe
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/unit/mail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const preStart = require('../prestart')
preStart.load()
const expect = require('chai').expect

describe('Test Mail', () => {
const mail = require('../../src/mail')
it('should be connect successful', async () => {
const result = !!(await mail.connect())
expect(result).to.be.true
})
it('Should be send successful', async() => {
mail.send({
to: 'a632079@gmail.com',
title: 'Hello',
body: 'Happy New Year!',
})
.then(res => {
console.log(res)
expect(!!res).to.be.true
})
.catch(err => {
console.log(err)
expect(false).to.be.true
})
//
})
})

0 comments on commit f5037fe

Please sign in to comment.