Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Refactored code to improve testability #60

Merged

Conversation

TomSeldonBoxUK
Copy link
Contributor

Refactored the task into modular chunks that are more easily tested.

Aside form being split up, the actual implementation logic is basically the same.

I think the goal here should be to test the grunt-recess task itself, not the Grunt API (which is already well tested) and not the RECESS library for the same reason. As such, I've focussed on adding some tests that check what is passed to the RECESS library from the task.

The tests themselves are a bit thin on the ground- the main work here was the refactor than enables the tests to actually work. Further tests can be subsequently added with ease.

For backwards compatibility, I've left the recess task in the Gruntfile so the output of the original 'tests' can still be seen. However, these aren't run as part of the Travis build (FYI, I added a Travis build file).

Once this is done I'll look at adding in the recessrc config option I discussed in the gulp-recess PR. Before that though, I want to make sure any changes are testable.

@sindresorhus
Copy link
Owner

Oh wow. This is really nice :)

sindresorhus added a commit that referenced this pull request Aug 5, 2014
@sindresorhus sindresorhus merged commit c43a841 into sindresorhus:master Aug 5, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants