开发者

Integrating Qunit into client side framework

Are there any examples of how Qunit can be implemented into a full scale devel开发者_如何学运维opment cycle. The existing examples seems to require hardcoding test scripts into production source code. Is there currently a way to separate unit tests and source code? I just want unit test code in dev code, not production.

Thanks P


Take a look at existing projects using QUnit, e.g. jQuery UI. The folder tests/unit contains all the QUnit-based unit tests. Is that separate enough?


1) Keep your tests on the dev. environment in a dedicated folder. E.g. like that

app-wwwroot/
  ├── js/
  │   └── moduleA.js
  └── tests/
      ├── moduleA/
      │    ├── dummies.js
      │    ├── stubs.js
      │    ├── mocks.js
      │    ├── fixtures.js
      │    └── unit-tests.js
      └── unit-tests.html

2) Exclude the folder from your deployment script or production branch in your version control system

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜