[FEAT][FIX] jest + fixes #7 + custom value serializer
This PR does the following:
- uses Jest for tests instead of Vows
- drop support to node < 6 (Jest requires node >= 6)
- fixes #7
- allow
showValuesoption ofasTree()andasLines()to be afunction, in which case it'll be used to render values.
I wanted and tried to write tests for my fixes and feature using Vows, but I found it hard to understand and change (not to blame the way @notatestuser wrote tests but blaming Vows itself here). Also the vows version was not standard and I couldn't make the tests to pass originally.
So I decided to totally drop Vows in favor to Jest, a more well known and used test runner/lib. Tho I tried to re-wrote the tests as close as possible to the way original ones were written.
If this will make you (@notatestuser) drop my PR, I guess I'll keep "treeify": "github:huafu/treeify" in the package.json of the repo where I use your tool. But sorry, I can't spend more time trying to make original Vows tests to work :-/
I've spent a lot of time trying to update the vows test in this repo myself, thanks a lot for having more of a crack at it. I'll take a look and hopefully merge this for a major release!
@notatestuser any news on this?
@notatestuser still mastering the tests? :stuck_out_tongue: