Introducing Google JS Test
google-opensource.blogspot.com
google-opensource.blogspot.com
For example:
var myObject = new Something("foo", "bar");
assert("simple operations", function() {
return myObject.doSomething() == "baz";
});;
assert("post-operational state", function() {
return myObject.state() == 123;
});;
assertAync("async polling", function() {
return myObject.poll().length > 0;
});;
Note that those tests would be much prettier in CoffeeScript.Is the purpose of heavy testing frameworks purely for the useful functions like "deepEquals"? If so, why not make a library with functions like "deepEquals" and use that library with a simple testing framework? Surely, there must be something I'm missing.
Edit: I should note that the beautifully written CoffeeScript compiler/translator doesn't use a testing framework (favoring a few simple hand-rolled functions), and it has a massive suite of tests.
For instance, many test runners will show you the expected and actual values when a comparison fails. If they're large blobs of text, it can show you a diff, etc.
Next, I opened up Image -> Adjustments -> Levels and dragged the grey (middle) adjustment slider toward the left to lighten the darker areas. Dragging the white (right) slider a little left also helps to reduce the maximum blackness of the image.
@GET "/", ( err, response ) =>
response.withJquery ( err, $ ) =>
@equal $( "#blah" ).text(), "Something"
Really cool stuff.Would anybody recommend any other unit-test frameworks for mocking stuff out?
http://tinnedfruit.com/2011/03/03/testing-backbone-apps-with...
If headless is not what you want, js-test-driver[1] looks promising. It has adapters for jasmine too.