This project is read-only.

"Unit Testing feature"?

Feb 11, 2014 at 1:39 AM
I'm looking into how to use the new Unit Testing feature in the latest dev build
I failed to find any docs so I started glancing at the source. I found the UnitTest.js file (the same one that can be added via add new file), but preliminary playing with it indicates it doesn't work

Are there docs for this feature?
Is it supposed to be working in the 2-07-14 dev build?

If its just me I'll file an issue.
Thanks for all the work on this project!
Feb 11, 2014 at 9:22 AM
You can add a unit test using Add New Item->Javascript UnitTest file
Open Test Explorer via Test->Windows->Test Explorer
Right-click on the test and select Run.

If you add a unit test file to your project after you've opened Test Explorer, it may not detect your new tests (known issue). Close and reopen the solution, and they should be detected.

We'll add more documentation for Beta release.

Let us know if that doesn't work, or if you need more help.
Feb 11, 2014 at 9:02 PM
Thanks for the help.
Unfortunately that wasn't the issue. I've filed an issue

For curiosity's sake, do tests support a done() callback to indicate an asynchronous test is finished?
And is there a way to use before or beforeEach (or TestInitialize, ClassInitialize) style functionality?
Feb 18, 2014 at 7:17 PM
For now, as you found out, it's very minimal support -- discover and run exported functions. I'm hoping we can improve it for beta. No guarantees we'll have time though.

Jasmine and Mocha were the most popular test frameworks in our survey, and we have work items for them: