tag:blogger.com,1999:blog-3728237926407785171.post2406564335368932505..comments2016-05-22T20:28:53.197-06:00Comments on CoffeeScript Love: Testing CoffeeScript with MochaChris Smithhttps://plus.google.com/117231929130530196454[email protected]Blogger8125tag:blogger.com,1999:blog-3728237926407785171.post-82237281715908956822012-11-16T11:08:02.772-07:002012-11-16T11:08:02.772-07:00@Anonymous (2012-03-30): Sheldon&#39;s answer wor...@Anonymous (2012-03-30):<br /><br />Sheldon&#39;s answer worked for me. So did this:<br /><br /> mocha array-test.coffee -r coffee-script -r should<br /><br />Unknownhttp://www.blogger.com/profile/06107197015989218339[email protected]tag:blogger.com,1999:blog-3728237926407785171.post-29845850107901143352012-09-01T02:23:42.191-06:002012-09-01T02:23:42.191-06:00I&#39;m getting output equivalent to Anonymous, ab...I&#39;m getting output equivalent to Anonymous, above.<br /><br />CoffeeScript 1.2.0, mocha version 1.0.3, should 0.6.3, npm 1.1.2<br /><br />Jeffs-Work-iMac:dojo_poc jeffdickey$ mocha array-test.coffee --require should<br /><br />/Users/jeffdickey/src/rails/dojo_poc/array-test.coffee:2<br />describe &#39;Array&#39;, -&gt;<br /> ^^^^^^^<br /><br />node.js:201<br /> throw e; // process.nextTick error, or &#39;error&#39; event on first tick<br /> ^<br />SyntaxError: Unexpected string<br /> at Module._compile (module.js:432:25)<br /> at Object..js (module.js:462:10)<br /> at Module.load (module.js:351:31)<br /> at Function._load (module.js:310:12)<br /> at Module.require (module.js:357:17)<br /> at require (module.js:373:17)<br /> at /usr/local/lib/node_modules/mocha/bin/_mocha:273:27<br /> at Array.forEach (native)<br /> at load (/usr/local/lib/node_modules/mocha/bin/_mocha:270:9)<br /> at Object. (/usr/local/lib/node_modules/mocha/bin/_mocha:261:1)<br /> at Module._compile (module.js:444:26)<br /> at Object..js (module.js:462:10)<br /> at Module.load (module.js:351:31)<br /> at Function._load (module.js:310:12)<br /> at Array.0 (module.js:482:10)<br /> at EventEmitter._tickCallback (node.js:192:40)<br /><br />And it sucks with a <em>very</em> hard vacuum that any HTML to aid formatting is disallowed; no TT, PRE or DIV allowed. There&#39;s a fine line between being functional and being paranoid; this isn&#39;t even in the same timezone. Jeff Dickeyhttp://www.blogger.com/profile/12760673999356987827[email protected]tag:blogger.com,1999:blog-3728237926407785171.post-28991833249479546372012-05-27T14:40:34.249-06:002012-05-27T14:40:34.249-06:00Mocha doesn&#39;t automatically handle coffeescrip...Mocha doesn&#39;t automatically handle coffeescript out of the box any more. So now you need to do this:<br /><br />mocha array-test.coffee --require should --compilers coffee:coffee-scriptSheldon Hearnhttp://starjuice.net/[email protected]tag:blogger.com,1999:blog-3728237926407785171.post-48724670085995158382012-05-10T22:37:57.922-06:002012-05-10T22:37:57.922-06:00Installing `mocha` and `should` might not go so ea...Installing `mocha` and `should` might not go so easily for you; if Jade breaks, see <a href="https://github.com/isaacs/npm/issues/2191#issuecomment-5643539" rel="nofollow">this comment</a> I made on an `npm` issue, where I documented the process that worked for me.Jeff Dickeyhttp://www.blogger.com/profile/12760673999356987827[email protected]tag:blogger.com,1999:blog-3728237926407785171.post-16861925362451604322012-04-09T04:12:29.544-06:002012-04-09T04:12:29.544-06:00mocha array-test.coffee -r coffee-script This wor...mocha array-test.coffee -r coffee-script<br /><br />This worked form me:)tom.koptelhttp://www.blogger.com/profile/02682743769889498551[email protected]tag:blogger.com,1999:blog-3728237926407785171.post-71867598146935957062012-04-01T06:28:14.614-06:002012-04-01T06:28:14.614-06:00make sure you&#39;ve got coffee-script as a depend...make sure you&#39;ve got coffee-script as a dependency (a devDependency will do)...Anonymous[email protected]tag:blogger.com,1999:blog-3728237926407785171.post-56788624024831785522012-03-30T11:43:51.954-06:002012-03-30T11:43:51.954-06:00Which version of Mocha do you have? Do you have Co...Which version of Mocha do you have? Do you have CoffeeScript?<br /><br />I&#39;ll get the latest version today and try for myself, I guess this might be a regression in Mocha though it doesn&#39;t seem likely. You might open a Mocha issue on GitHub.@quartzmohttp://www.blogger.com/profile/15222755899473111565[email protected]tag:blogger.com,1999:blog-3728237926407785171.post-43002001285979045072012-03-30T01:39:07.974-06:002012-03-30T01:39:07.974-06:00Running into problems trying to test with coffeesc...Running into problems trying to test with coffeescript. Running tests on Javascript files succeeds though. Get the following on attempting to run mocha with coffeescript files.<br /><br />SyntaxError: Unexpected string<br /> at Module._compile (module.js:429:25)<br /> at Object..js (module.js:459:10)<br /> at Module.load (module.js:348:31)<br /> at Function._load (module.js:308:12)<br /> at Module.require (module.js:354:17)<br /> at require (module.js:370:17)<br /> at /home/sameet/testcode/coffeepress/node_modules/mocha/bin/_mocha:261:27<br /> at Array.forEach (native)<br /> at load (/home/sameet/testcode/coffeepress/node_modules/mocha/bin/_mocha:258:9)<br /> at Object. (/home/sameet/testcode/coffeepress/node_modules/mocha/bin/_mocha:249:1)<br /> at Module._compile (module.js:441:26)<br /> at Object..js (module.js:459:10)<br /> at Module.load (module.js:348:31)<br /> at Function._load (module.js:308:12)<br /> at Array.0 (module.js:479:10)<br /> at EventEmitter._tickCallback (node.js:192:40)<br />make: *** [test] Error 1Anonymous[email protected]