Sublime Forum

[BUG] Build doesn't show all output

#1

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.

0 Likes

#2

I’ve got the same same issue with my JSHint plugin. The build file is executing correctly, but no output is displaying at all. Works perfectly in Mac OS X and Linux. I’ve spend all day a million ways to change my code, but I believe this is actually a bug in Windows Sublime Text 2 that I can’t fix.

github.com/uipoet/sublime-jshint

0 Likes

#3

I’ve just started using sublime and encountered the same problem. I think it might be to do with the output of mocha using ansi-escape coloring, as when I use a reporter without coloring (such as TAP) then it seems to work ok.

0 Likes