JSRocksHQ / harmonic

The next static site generator
http://harmonicjs.com/
MIT License
282 stars 26 forks source link

Unit tests #63

Closed jaydson closed 9 years ago

jaydson commented 9 years ago

Create unit tests for Harmonic.

UltCombo commented 9 years ago

+1 Do you have any particular test framework in mind? I have experience with Mocha, Jasmine and some other frameworks but I'm not sure what would be the best for testing a project such as Harmonic.

jaydson commented 9 years ago

Thumbs up for Mocha! I used Chai on https://github.com/jaydson/marked-metadata. Can you start structuring and writing some tests?

UltCombo commented 9 years ago

Yeah, but I guess I'll need a bit of time to think about a good tests structure -- after all, we don't want to start with a test structure that ends up in an unmaintainable mess. I'll think a bit about this while I fix some other issues and I'll probably have some tests up by the end of the night. :P

jaydson commented 9 years ago

:+1:

UltCombo commented 9 years ago

I've started working on this, see the unit-tests branch.

So far the tests only cover the very basic CLI usage (init and build), feel free to take a look and add new tests or edit the existing ones when you have time. =]

Obviously, there should be another tests suite (describe()) for individual exported methods of the core, parser, helpers and util, though I guess some of those depend on global state and may be slightly more complicated to test.

jaydson commented 9 years ago

That's great @UltCombo . I'll take a look soon.

UltCombo commented 9 years ago

Landed unit tests on the master branch. =]

jaydson commented 9 years ago

Awesome! I'll check and contribute with new tests soon.