开发者

Is there a framework for unit-testing both JavaScript and HTML

Is it possible to check the validity of your JavaScrip开发者_Python百科t code, even modern techniques and JavaScript calls with some form of validity checker? I have seen some that check JavaScript but about with the combination of your HTML document, possibly with CSS, possibly 'src' include path, etc?

And what are the normal approaches for this type of testing?


JS Unit - https://github.com/pivotal/jsunit : Simple JavaScript unit test framework. Use it to check your code.

Selenium - http://seleniumhq.org/ : Use it to test your sites interface.

Use http://browsershots.org/ (free) to test the look of your site in different rendering engines.

If you maintain some semblance of testing there should be no need to make sure your code "validates", as perfectly valid code carries no guarantee of doing what you want it to.


If you're doing interface testing it's best to go with a framework like Selenium : http://seleniumhq.org/

You can create test suites and run them automatically when you do changes to your front end to make sure everything is still working as you expect.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜