Due to a name clash with another JavaScript project I have renamed my project to J5tester and released version 0.2. This version has the rename and a jsio wrapper which will fix the need for a patch to jsio. There are still some fixes that are being added to jsio’s git module and should show up some time tomorrow. The j5tester git repo will also take a bit of time to move over. Sorry for the brief inconvenience.
Introducing Jester. Jester is a JavaScript unit tester based around GNOME’s Gjs JavaScript engine. I wrote it because I needed a stand alone tester for testing non-DOM JavaScript code in my AMQP Bindings (kamaloka-js). I also wanted to learn the ins and outs of Gjs and GLib Introspection while making it relevant to my friends in the GNOME Community. By utilizing a separate run time for non-DOM code I hope to encourage the separation of browser and generic JavaScript code for the sake of reuse across browser and desktop platforms.
Jester has a couple of components and can be used indirectly or directly by Gjs applications. The first component is the jester standalone application which can load and run a JavaScript file from the command line. Use this to integrate with test workflows such as make check or to simply test out some quick JavaScript. The second component is the jester.js module which can be loaded directly in a Gjs application. This module contains the Test class which is used to write unit tests.
Here is a simple example of how to use Jester:
test.js
const Jester = imports.jester;
let test = {
testExample: function() {
this.assertEquals(1, 1, "This test should always pass");
this.assertEquals(1, 2, "This test should fail");
}
}
this.info("Jester Example");
let test_suite = new Jester.Test({"Simple Test": test});
test_suite.run();
To run this code you would enter this on the command line:
jester test.js
Home Page: http://live.gnome.org/Jester
0.1 Tarball: http://live.gnome.org/Jester?action=AttachFile&do=view&target=jester-0.1.tar.bz2
Git:
- anonymous – git://git.gnome.org/jester
- commit access – ssh://USERNAME@git.gnome.org/git/jester
Since kamaloka-js is built on top of js.io, I have create a patch for js.io which makes the importer work when used with Jester.
[read this post in:
ar de es fr it ja ko pt ru zh-CN ]
Ladies and gentlemen, God Street Wine is getting back together for a couple of shows this summer and their fan club presale tickets go on sale in a half hour. I was bummed because I was getting on a flight to Austin for a friend’s wedding, right before ticketing opened. Well, I am on that flight now and apparently all American Airlines domestic flights have WiFi. Technology can be awesome sometimes (usually when it makes it easier to do every day things). Let’s just hope my battery doesn’t die before I can snag a few tickets.
Note: Fedora connected flawlessly. Bar none, we have the easiest networking setup out there. Dan Williams has done a kick ass job with Network Manager!
Update: Just purchased six tickets for Friday and six for the Saturday shows! The money goes to a good cause and I have plenty of friends who will come back to NY for this.
[read this post in:
ar de es fr it ja ko pt ru zh-CN ]
// Because sometime you just need everything in the global context
var Module = imports.module;
for (i in Module)
this[i] = Module[i];
// note this only works from scripts eval'ed via the C API
// gjs_context_eval or gjs_context_eval_file
// as this == [global object]
[read this post in:
ar de es fr it ja ko pt ru zh-CN ]
Comments Off