开发者

Is javascript unit testing a good idea? [closed]

开发者 https://www.devze.com 2023-04-04 04:32 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. 开发者_Go百科 Closed 11 years ago.

I've been wondering this for a while and what framework is the best. I was going to look at JSUnit, but it looks like it's not actively maintained anymore.

Anybody know the pros-cons of the active unit testing frameworks? I would love to benefit from some of your experience.

EDIT: JsUnit... Not JUnit


JavaScript unit testing is a must. Especially on the server.

JavaScript is a weakly typed dynamic language and it's easy to make mistakes, unit testing will allow you to have confidence about the stability of your source code.

Automated unit tests for the server allow you to re factor easily and automated unit tests for the client allow you to assert browser compliance after every change

As for unit testing frameworks I would recommend vows-is for node.js and QUnit for the client-side.

Eventually I will port vows-is to work nicely as a client-side unit testing framework but it's not ready for that yet.


JUnit is for Java - Not Javascript. Javascript runs on the browser - and I cannot think of anyway of unit testing. Javascript is just to make web pages interactive.

If you want to test a web page you need something like Quick Test Pro - for example.

0

精彩评论

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

关注公众号