开发者

How to use FireUnit to test my web page?

Can someone please tell me how can i test 开发者_如何学Pythonmy web page in FireUnit? http://ejohn.org/blog/fireunit/


I just played around with it last week and wrote a few test cases. You'll want to create a test case file and include it as part of your page. (perhaps use a conditional like "debug=true" to prevent inclusion during production)

I found the .Compare method to be the most useful. You can write stuff like:

fireunit.compare(
  "expected result",
  callToFunction2(), // tested
  "This is the test name"
);

Note that since you are comparing strings here, if you want to do JSON instead, you'll have to JSON.stringify the output first.

Upon running the page with the included js file, you'll see test results under the "Test" panel of firebug. (assuming you have the extension installed)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜