Revert "Revert "correct error code when tests fail""

This reverts commit 6a47a9be1d8854f959df1b8bf20e7ae1a8052597.

Conflicts:
	lib/tasks/karma.rake