I’m trying to make a simple build system that runs Mocha (visionmedia.github.com/mocha/) to run some tests. The problem is that Sublime Text 2 doesn’t show all the build output; it’ll cut off in the middle of a line (and then append “[Finished]” to the end of that line). I’ve never yet seen it show the build output in its entirety.
I’ve narrowed it down to a simple repro case. My mocha.sublime-build file is:
{
"cmd": "cmd", "/c", "c:/path/to/mocha", "test.js"]
}
and “test.js” contains this (adapted from the first example from visionmedia.github.com/mocha/, but changed not to require any extra libraries):
describe('Array', function(){
describe('#indexOf()', function(){
it('should return -1 when the value is not present', function(){
console.assert([1,2,3].indexOf(5) === -1);
console.assert([1,2,3].indexOf(0) === -1);
})
})
})
If I run “mocha test.js” from a command prompt, it shows all the expected output:
-
a line indented two spaces, followed by a single dot (showing the test being run)
-
a blank line
-
a line indented two spaces, followed by a Unicode character that’s supposed to be a check mark (U+2714, not actually displayed properly in a Windows console window) and " 1 tests complete (3ms)"
-
two more blank lines.
However, if I run Mocha from Sublime Text, the output shown in the output window cuts off long before it gets to the “1 tests complete” line. Instead, it usually either shows just:
-
a blank line, a two-space indent, and “[Finished]”; or
-
a blank line, a two-space indent, a dot, a newline, and “[Finished]”.
I’ve also occasionally see it show no output at all before “[Finished]”.
Running the 64-bit install of Sublime Text 2 build 2165 on Windows Vista x64.