Developing UI in JavaScript using TDD Principles

前端 未结 7 2013
有刺的猬
有刺的猬 2020-12-22 22:54

I\'ve had a lot of trouble trying to come up with the best way to properly follow TDD principles while developing UI in JavaScript. What\'s the best way to go about this?

7条回答
  •  感动是毒
    2020-12-22 23:23

    I'm just about to start doing Javascript TDD on a new project I am working on. My current plan is to use qunit to do the unit testing. While developing the tests can be run by simply refreshing the test page in a browser.

    For continuous integration (and ensuring the tests run in all browsers), I will use Selenium to automatically load the test harness in each browser, and read the result. These tests will be run on every checkin to source control.

    I am also going to use JSCoverage to get code coverage analysis of the tests. This will also be automated with Selenium.

    I'm currently in the middle of setting this up. I'll update this answer with more exact details once I have the setup hammered out.


    Testing tools:

    • qunit
    • JSCoverage
    • Selenium

提交回复
热议问题