Analogy is a project mainly written in JavaScript, it's free.
Use QUnit instead. Status - Idle
Analogy is currently in development. The master does not currently work.
Currently it fails number 1 as it needs external CSS and JQuery to work. I'm working to fix this in a later release.
Import Analogy in your header.
<script src="baby.js" type="text/javascript" charset="utf-8"></script>
<link href="analogy.css" rel="stylesheet" media="screen" charset="utf-8" />
Write your tests like so. A test returns true or false.
analogy.tests.add_test("default date should be offset from present date by the correct amount", function() {
var march_2010 = new Date(Date.parse('Mar 8, 2010'));
var nov_2010 = new Date(Date.parse('Nov 8, 2010'));
var july_2011 = new Date(Date.parse('Jul 8, 2011'));
condition_1 = myapp.default_date(march_2010, 8).getTime() === nov_2010.getTime();
condition_2 = myapp.default_date(nov_2010, 8).getTime() === july_2011.getTime();
return condition_1 && condition_2;
});
call
baby.tests.init();
baby.tests.do();
This codebase is at an early stage and is subject to change...