<div dir="ltr"><div>Can't quite get karma to work<br><br>INFO [karma]: Karma server started at <a href="http://localhost:9876/">http://localhost:9876/</a><br>WARN [watcher]: Pattern "/home/dnarvaez/Development/sugar-build/build/out/install/lib/node_modules/karma/adapter/jasmine.js" does not match any file.<br>
WARN [watcher]: Pattern "/home/dnarvaez/Development/sugar-build/build/out/install/lib/node_modules/karma/adapter/require.js" does not match any file.<br>WARN [web server]: 404: /home/dnarvaez/Development/sugar-build/build/out/install/lib/node_modules/karma/static/testacular.js<br>
WARN [web server]: 404: /home/dnarvaez/Development/sugar-build/build/out/install/lib/node_modules/karma/static/testacular.js<br><br></div><div>Looks like testacular.js and jasmine are not installed. Tried both 0.8.5 in git and from npm.<br>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 13 May 2013 16:22, Manuel Quiñones <span dir="ltr"><<a href="mailto:manuq@laptop.org" target="_blank">manuq@laptop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
As I am currently implementing sugar palettes in HTML, I want to get<br>
the logic right, so I need unit tests.  Then I started to investigate<br>
unit testing in javascript.<br>
<br>
After looking for a bit, I decided to give a try to Jasmine framework,<br>
which is AngularJS choice.<br>
<br>
<a href="http://pivotal.github.io/jasmine/" target="_blank">http://pivotal.github.io/jasmine/</a><br>
<br>
My first attempt was running the tests in the command line with jasmine-node.<br>
<br>
<a href="https://github.com/mhevery/jasmine-node" target="_blank">https://github.com/mhevery/jasmine-node</a><br>
<br>
But soon I realized that testing without access to the DOM is very<br>
limited.  For example, a palette needs to add a <div> to the document.<br>
 And my second test failed in jasmine-node because of that.<br>
<br>
So I went for Karma (previously named Testacular).<br>
<br>
<a href="http://karma-runner.github.io/" target="_blank">http://karma-runner.github.io/</a><br>
<br>
It was easy to configure using RequireJS like is documented in:<br>
<br>
<a href="http://karma-runner.github.io/0.8/plus/RequireJS.html" target="_blank">http://karma-runner.github.io/0.8/plus/RequireJS.html</a><br>
<br>
And it works!  You can try installing Karma (npm install -g karma) and<br>
then checking out in my clockjs activity.<br>
<br>
git checkout git://<a href="http://github.com/manuq/clockjs.git" target="_blank">github.com/manuq/clockjs.git</a><br>
cd clockjs/lib/sugar-html-graphics<br>
karma start<br>
<br>
And then point a browser to the URL in the output, which points to Karma server.<br>
<br>
--<br>
.. manuq ..<br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Daniel Narvaez<br>
</div>