Developing UI in JavaScript using TDD Principles

前端 未结 7 1904
有刺的猬
有刺的猬 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:33

    What I do is to poke the Dom to see if I'm getting what I expect. A great side effect of this is that in making your tests fast, you also make your app fast.

    I just released an open source toolkit which will help with JavaScript tdd immensely. It is a composition of many open source tools which gives you a working requirejs backbone app out of the box.

    It provides single commands to run: dev web server, jasmine single browser test runner, jasmine js-test-driver multi browser test runner, and concatenization/minification for JavaScript and CSS. It also outputs an unminified version of your app for production debugging, precompiles your handlebar templates, and supports internationalization.

    No setup is required. It just works.

    http://github.com/davidjnelson/agilejs

    0 讨论(0)
提交回复
热议问题