Improve output of Coffeescript tests
Setup of Coffeescript suffers from a couple of problems:
- Passed assertions spam green
- Assertion messages emitted when
assertEqualspasses are awkward:Test Passed: Value == 1. - Docs mention it uses Codewars Tests Framework but it's not clear how. Coffeescript docs do not link to it (Javascript docs do tho). Reference of the Codewars Testing Framework appears to be missing some funcitonalities and/or details (tolerance of
assertApproxEquals, range ofrandomNumberandrandomToken). - It's not clear whether
chaican be used. It's not listed as a supported library, but it can be used withrequire('chai'). But when used, feedback of passed assertions is incorrect:

CoffeeScript is tested by creating test.coffee by concatenating preloaded, solution, and tests like the following:
require('/runner/frameworks/javascript/cw-2') # defines `Test`
assert = require('assert')
Test.handleError ->
# preloaded
# solution
do ->
Test = global.Test
describe = global.describe
it = global.it
before = global.before
after = global.after
# tests
Then running it with coffee ./test.coffee.
It's using the custom test framework and I don't think it's been updated since https://github.com/codewars/codewars-runner-cli/blob/master/frameworks/javascript/cw-2.js
The custom test framework is no longer maintained, so to fix the issues, we'll need to add a new language version that uses Mocha and @codewars/test-compat like Node 12. I'm pretty sure the same packages can be used as is.
Where do assertions come from, and where would they come from in the potential new setup? is this Node assert, or something else?
assert = require('assert') from the above is importing Node's assertion.
In the new setup, old assertions can be used with Test = require('@codewars/test-compat') or chai can be used directly.
The issue with the test output is related to Node v8 being used, at least for chai assertions. The same behaviour can be observed by running a JS/TS Kata that uses chai in the Node v8 runner, it produces the same highly verbose output on passed tests as the current CS runner does.
No, that's because Node v8 uses the custom "Codewars test framework" just like CoffeeScript. We started using Mocha instead since Node 10.