Upgrade to Pro — share decks privately, control downloads, hide ads and more …

"Buster.JS" ClinetSide Javascript testing

KAZUMA Ukyo
October 15, 2012

"Buster.JS" ClinetSide Javascript testing

a Buster.JS introduction

KAZUMA Ukyo

October 15, 2012
Tweet

More Decks by KAZUMA Ukyo

Other Decks in Programming

Transcript

  1. “ ” A browser JavaScript testing toolkit. It does browser

    testing with browser automation (think JsTestDriver), QUnit style static HTML page testing, testing in headless browsers (PhantomJS, jsdom), and more. Take a look at the overview!
  2. “ ” A browser JavaScript testing toolkit. It does browser

    testing with browser automation (think JsTestDriver), QUnit style static HTML page testing, testing in headless browsers (PhantomJS, jsdom), and more. Take a look at the overview!
  3. “ ” A browser JavaScript testing toolkit. It does browser

    testing with browser automation (think JsTestDriver), QUnit style static HTML page testing, testing in headless browsers (PhantomJS, jsdom), and more. Take a look at the overview!
  4. buster.js var runner = module.exports; runner["browser test"] = { env

    : "browser", sources : [ "lib/test_object.js" ], tests : [ "tests/test_object_tests.js" ] }
  5. test_object.js var test_object = { number : 10, dom :

    function(target) { target.innerHTML = "Hello Buster.JS!" } }
  6. Run

  7. $ buster test Chrome 22.0.1229.94, OS X 10.7 (Lion): .

    Firefox 14.0.1, OS X 10.7 (Lion): . Mobile Safari 6.0, OS X (iPhone): . 3 test cases, 3 tests, 3 assertions, 0 failures, 0 errors, 0 timeouts Finished in 0.015s
  8. test_object_spec.js buster.spec.expose(); describe("A test_object module", function () { it("dom", function

    () { var p = document.createElement("p") test_object.dom(p); expect(p.innerHTML).toEqual("Buster.JS"); }); });