Ranks/emojione — pull request #9 by garu (2014-09-15 06:54:12+00:00)
Title: generic test suite for Emojione (+ JS implementation)

Hi everyone! Thanks for Emojione, it's great!

This patch is meant to help testing Emojione and its different implementations.

The file ```lib/validate.yml``` contains a cross-platform definition of the test cases for the Emojione library, in a similar fashion to Twitter's (https://github.com/twitter/twitter-text-conformance). It should provide tests covering all of Emojione's features.

This allows for different implementations of Emojione, such as the php and js one, to stay in a consistent, stable and interoperable state.

The file ```lib/js/js-test``` implements the JavaScript tests for Emojione. It is a small & portable Perl program that parses ```lib/validate.yml``` and auto-generates a file called ```lib/js/tests.html```, containing QUnit JavaScript tests for Emojione, then fires up those tests on the web browser. Note that I have put ```lib/js/test.html``` under ```.gitignore``` to prevent it from becoming static. To run the tests, all you have to do is go to ```lib/js/``` and type:

```
./js-test
```

I have not implemented the tests for PHP, but it's all a matter of parsing 'lib/validate.yml' and seeing if the functions yield the proper output for the given input.

If this is merged, I plan on auto-generating tests for expresso as well, so they can be run from node.js via ```npm test``` too, allowing integration with Travis-CI and friends.

I hope you find this useful! Thanks again =)