[Sugar-devel] Unit tests in Sugar HTML

Daniel Narvaez dwnarvaez at gmail.com
Sun May 19 12:31:24 EDT 2013


Can't quite get karma to work

INFO [karma]: Karma server started at http://localhost:9876/
WARN [watcher]: Pattern
"/home/dnarvaez/Development/sugar-build/build/out/install/lib/node_modules/karma/adapter/jasmine.js"
does not match any file.
WARN [watcher]: Pattern
"/home/dnarvaez/Development/sugar-build/build/out/install/lib/node_modules/karma/adapter/require.js"
does not match any file.
WARN [web server]: 404:
/home/dnarvaez/Development/sugar-build/build/out/install/lib/node_modules/karma/static/testacular.js
WARN [web server]: 404:
/home/dnarvaez/Development/sugar-build/build/out/install/lib/node_modules/karma/static/testacular.js

Looks like testacular.js and jasmine are not installed. Tried both 0.8.5 in
git and from npm.



On 13 May 2013 16:22, Manuel Quiñones <manuq at laptop.org> wrote:

> Hello,
>
> As I am currently implementing sugar palettes in HTML, I want to get
> the logic right, so I need unit tests.  Then I started to investigate
> unit testing in javascript.
>
> After looking for a bit, I decided to give a try to Jasmine framework,
> which is AngularJS choice.
>
> http://pivotal.github.io/jasmine/
>
> My first attempt was running the tests in the command line with
> jasmine-node.
>
> https://github.com/mhevery/jasmine-node
>
> But soon I realized that testing without access to the DOM is very
> limited.  For example, a palette needs to add a <div> to the document.
>  And my second test failed in jasmine-node because of that.
>
> So I went for Karma (previously named Testacular).
>
> http://karma-runner.github.io/
>
> It was easy to configure using RequireJS like is documented in:
>
> http://karma-runner.github.io/0.8/plus/RequireJS.html
>
> And it works!  You can try installing Karma (npm install -g karma) and
> then checking out in my clockjs activity.
>
> git checkout git://github.com/manuq/clockjs.git
> cd clockjs/lib/sugar-html-graphics
> karma start
>
> And then point a browser to the URL in the output, which points to Karma
> server.
>
> --
> .. manuq ..
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130519/a5791252/attachment.html>


More information about the Sugar-devel mailing list