<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Erik A. Hanson &#187; Jaxer</title>
	<atom:link href="http://www.eahanson.com/category/jaxer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eahanson.com</link>
	<description>My weblog</description>
	<lastBuildDate>Mon, 24 May 2010 04:49:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Running Jasmine Tests Through Jaxer</title>
		<link>http://www.eahanson.com/2009/06/04/running-jasmine-tests-through-jaxer/</link>
		<comments>http://www.eahanson.com/2009/06/04/running-jasmine-tests-through-jaxer/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 00:51:39 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Jasmine]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Jaxer]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.eahanson.com/?p=98</guid>
		<description><![CDATA[Jasmine? Jaxer? Jasmine is a new Javascript testing framework from my pals at Pivotal Labs. Jaxer is an Apache module that wraps Firefox&#8217;s Javascript and rendering engine, providing a server-side Javascript environment that&#8217;s fast and compatible with any JS that works in Firefox (including all kinds of DOM manipulation and libraries like Prototype, jQuery, etc.). [...]]]></description>
			<content:encoded><![CDATA[<h3>Jasmine? Jaxer?</h3>
<p><a href="http://github.com/pivotal/jasmine/tree/master">Jasmine</a> is a new Javascript testing framework from my pals at <a href="http://pivotallabs.com/">Pivotal Labs</a>. </p>
<p><a href="http://www.aptana.com/jaxer">Jaxer</a> is an Apache module that wraps Firefox&#8217;s Javascript and rendering engine, providing a server-side Javascript environment that&#8217;s fast and compatible with any JS that works in Firefox (including all kinds of DOM manipulation and libraries like Prototype, jQuery, etc.).</p>
<h3>Running Jasmine Tests Through Jaxer</h3>
<p>Part of an app I&#8217;m writing uses Jaxer and I wanted to write my tests in Jasmine, so I wrote a test runner and reporter to bridge the two, and then I wrote a rake task to run the tests.</p>
<p>So now I can run &#8220;rake spec&#8221; and my JS tests will run, in Firefox, but without having to actually have Firefox open up (or be installed).</p>
<p>So:</p>
<pre>
rake spec
</pre>
<p>returns:</p>
<pre>
.    foo should do something.
.    foo should do something else.
.    foo should do yet another thing.

3 of 3 specs passed
</pre>
<p>And the whole thing takes <b>0.37 seconds</b>. It should be noted that those are trivial tests, but running a JS test suite with only 0.37 seconds of overhead is pretty neat.</p>
<p>My rake task looks like:</p>
<pre>
task :spec do
  results = `curl -s http://127.0.0.1:8081/jaxer-service/jasmine-jaxer`
  print results
  fail "spec failures" if results.match(/FAILURES!/)
end
</pre>
<h3>Download</h3>
<p>The JS code that hooks Jasmine to Jaxer is here: <a href="http://www.eahanson.com/code/jasmine-jaxer.js">jasmine-jaxer.js</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eahanson.com/2009/06/04/running-jasmine-tests-through-jaxer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
