Telerik® JustCode™ by Progress

Telerik® JustCode™'s unit test runner allows you to run and debug WinJS tests.

Setup your environment

  1. Download qunitmetro.js (found here). Then add qunitmetro.js in the "js" folder of your application and add the following code to your startup page (default.html) to setup the QUnitMetro references: <script src="/js/qunitmetro.js"></script>
  2. Add QUnitMetro.JustCode.js (found in (JustCodeInstallationFolder)/Libraries/Extensions/QUnit/Scripts) in the "js" folder of your application and add the following code to your startup page (default.html) to setup the QUnitMetro references: <script src="/js/QUnitMetro.JustCode.js"></script>

Write WinJS tests

  1. Create a javascript file for your tests.
  2. Use the QUnit syntax to write unit tests. For instance: test( "hello test", function() { ok( 1 == "1", "Passed!" ); });

To Run and Debug Tests from Unit Test Window

  1. Navigate on the main menu Just Code / Windows / Show Unit Test Window. Unit Test Window opens.
  2. From here you can choose how to run or debug your tests from a couple of options:

    1. Unit Test Window Icon Run Selected Tests Run Selected Tests - Select the tests you want to run from the tree and click the button.
    2. Unit Test Window Icon Run All Tests Run All Tests - Click the button to run all tests inside your solution.
    3. Unit Test Window Icon Debug Selected Tests Debug Selected Tests - Select tests that you want to debug from the tree and click the button.
    4. Test Select Tests 2 Run
    5. Once you've run a test, JustCode will start your application in a simulator and a progress bar will be shown to indicate how many tests are currently running. Also a busy indicator is shown next to currently running test, the class and namespace it's defined in. Once all test are run JustCode will automatically close the application (but not the simulator).

      Test Run Progress

      Test Test Running
    6. You can click the Unit Test Window Icon Abort Test Run button to abort a test run.
    7. As soon as all tests have been run, results are shown on the right side.

    To Run and Debug Tests from Solution Explorer Window

    1. Open the Solution Explorer Window.
    2. From the solution tree select the item that contains the unit tests you would like to run.

      This item can be either a solution folder, project, folder or a single file.

    3. Right-Click the selected item.
    4. From here you can choose whether to run or debug your tests:

      1. Unit Test Window Icon Run Selected TestsRun Tests - simply runs all tests contained in the selected item.
      2. Unit Test Window Icon Debug Selected TestsDebug Tests - executes in debug mode all tests contained in the selected item.
      3. Just Run Test Solution Explorer

      Note

      Options

      You can find an option in JustCode->Options->Unit Testing that determines whether the application should be started in a simulator or not.

      Supported frameworks

      • QUnitMetro

      See Also

      Other Resources