River
River

Reputation: 1487

Integrating Qunit into client side framework

Are there any examples of how Qunit can be implemented into a full scale development 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

Upvotes: 2

Views: 388

Answers (2)

Dmitry Sheiko
Dmitry Sheiko

Reputation: 2182

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

Upvotes: 1

Jörn Zaefferer
Jörn Zaefferer

Reputation: 5705

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?

Upvotes: 2

Related Questions