|
JasUnit
A slim unit testing framework for JavaScript
IntroductionJasUnit is a slim unit testing framework for JavaScript, following the general design principles of xUnit. DetailsFor testing your code, JasUnit allows you to:
ExamplesThe following are some examples on how you might use JasUnit. JasUnit.setup({
logger: new JasUnit.DefaultLogger("output"),
pushAssertionsToGlobal: true // optional.
});
JasUnit.runTests({
namespace: "Tests.Sample",
testOne: function() { Assert.isTrue( false ); }
});
// assertIsTrue is global because of 'pushAssertionsToGlobal'
JasUnit.runTests({
namespace: "Tests.Sample",
testOne: function() { assertIsTrue.isTrue( false ); }
});
// we can explicitly use the assertion scope (not really recommended)
with(JasUnit.assertScope)
{
JasUnit.runTests({
namespace: "Tests.Sample",
testOne: function() { assertIsTrue.isTrue( false ); }
});
}
|
► Sign in to add a comment