guileen / node-sendmail

send mail without setting up a SMTP server

Home Page:http://guileen.github.com/node-sendmail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Testing

GreenPioneer opened this issue · comments

Add testing to the module

As you may or may not now, we have some modules published of our own and we almost always fully test our modules.
You can check these out: Mollie-ES6 and obj-denied.

Is that the kind of testing you'd like? Because I can make a start like that if you'd like.

@Geex-Renzo Testing Branch . I have to wipe my computer tonight so i pushed what i had started on and so far its really bare bones . But the idea is to test our that our emails are comming out as expected and then to test that were getting back good data back when we look at the hosts domain.

Have you looked at the way I make the tests?
Because for starters, I have no idea why you have added "ical-toolkit" to the testing script.

I think the following should be done:
The main file should be refactored.
Functions declared in the main export should be placed in some sort of library folder (lib) and the individual functions should be tested as well.
This way, you're always sure it works the way you think you do, even if you add something new.

I added "icall toolkit" to test creating appointments and sending them through send mail

you make some good points. I think i will actually merge your code in and rewrite from there for testing.

Nice, thanks for the merge!
I think it's a good call to first start with writing the tests, before adding something new, to make sure the project works as is. This way, we can also make sure it works like it did, after adding "icall toolkit".

Would you like it if I made a start with writing tests, the way I'm used to doing it?

Yea i think that would be a huge help cause this holiday season has really just taken my time. Hope you had a merry christmas @Geex-Renzo and a have a happy new year

Talk soon

No problem, I'll make a start this week ;)
And yes, thank you, I had a merry Christmas, I hope you did as well!
Happy new year @GreenPioneer!

@GreenPioneer I've started to work on the tests on a fork of this repo, since I don't have access to this repo.
You can see my progress here: https://github.com/Geexteam/node-sendmail/tree/tests

It looks like a good start. Keep up the good work @Geex-Renzo

@GreenPioneer @Geex-Renzo I could help with tests

@geofmureithi Sounds good, I'll add a PR for my current status of the testing branch tomorrow, maybe you can work from there.

@Geex-Renzo Not yet??

@geofmureithi @Geex-Renzo I'm looking at picking this back up to get this done because it's becoming apparent we need testing now more than ever

Sorry @GreenPioneer I've been busy with my internship so I don't have a lot of time atm...
I can look at them tonight, as my new project needs this package (again) as well :)
I'll get back to you within 48 hours, okay? :)

@geofmureithi @Geex-Renzo
Sounds like testing will happen

Maybe we should also talk about 2.x features as well and bundle in testing?

do you guys have any thoughts towards 2.x ?

@GreenPioneer I will just work on unit testing using mocha. Let me see if we can do some integration tests.
On 2.x, inbuilt promises would be good for a start.
Allocate me some tasks btw 😉

@GreenPioneer
Also is it possible we can modularize the internal functions such as getHost to allow better unit testing?