unit testing - How to use FireUnit to test my web page? -
can please tell me how can test web page in fireunit? http://ejohn.org/blog/fireunit/
i played around last week , wrote few test cases. you'll want create test case file , include part of page. (perhaps use conditional "debug=true" prevent inclusion during production)
i found .compare method useful. can write stuff like:
fireunit.compare( "expected result", calltofunction2(), // tested "this test name" );
note since comparing strings here, if want json instead, you'll have json.stringify output first.
upon running page included js file, you'll see test results under "test" panel of firebug. (assuming have extension installed)
Comments
Post a Comment