inventid / tails

Models on the fly!
MIT License
1 stars 0 forks source link

Better coverage #58

Open steffansluis opened 9 years ago

steffansluis commented 9 years ago

This PR adds better coverage to Tails by using browserify instead of coffee to create a browser version of Tails. Previously, the coffee command would join the all the sources before compilation, resulting in test coverage over one file. It was then bundled with all the dependencies using concat.

This PR changes the build steps. coffee will no longer join the files before compilation, resulting in a separate module per file (and separate exports), that allow for Node-style importing of parts of Tails. These modules are joined in the right order (automatically) by browserify, yielding a browser compatible version of Tails in the tails.browser.js file. This file is then bundled along with all the external dependencies using concat as before.

The part that allows for the better coverage and that is the main reason for this PR is the browserify step, which can apply a transform on each file during bundling. Using the browserify-istanbul template as a transform along with our existing grunt-template-jasmine-istanbul magically results in coverage data per file since the files are instrumented by the browserify-istanbul template before joining.

Other consequences of this PR are the renaming of the statistics folder to stat, the fact that in some places there are require-statements inside of function to prevent circular dependencies and the rivets-tails.coffee file not exporting anything, since it...doesn't...export...anything...

I think this PR might be ready to be merged, but please proceed with caution since a lot of things have been changed. Please look over the changes and let me know what you think @joostverdoorn @rogierslag

rogierslag commented 9 years ago

I really like the changeset and I see nothing wrong with it. I still would like to test it on staging and development before letting production depend on it though

Good job! :+1:

steffansluis commented 8 years ago

@joostverdoorn @rogierslag Is this PR still useful? I think I heard something about reviving Tails, but for now, I think this PR should be either merged or closed, depending on whether or not you are still using Tails in its current form.

rogierslag commented 8 years ago

Right now its still being used, but in the near future we plan on dropping it in favour of Graphql