SOURCE CODE: UIZE Unit Tests
VIEW EXAMPLE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>UIZE Unit Tests | JavaScript Examples | UIZE JavaScript Framework</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="keywords" content="Uize.Test Uize.Widgets.Log.Widget UizeSite.Widgets.UnitTests.Widget"/>
  <meta name="description" content="See how to run the various unit tests of the UIZE JavaScript Framework. Run a unit test and watch as the test runner chunks through its tests."/>
  <link rel="alternate" type="application/rss+xml" title="UIZE JavaScript Framework - Latest News" href="http://www.uize.com/latest-news.rss"/>
  <link rel="stylesheet" href="../css/page.css"/>
  <link rel="stylesheet" href="../css/page.example.css"/>
</head>

<body>

<script type="text/javascript" src="../js/Uize.js"></script>

<h1 class="header">
  <a id="page-homeLink" href="../index.html" title="UIZE JavaScript Framework home"></a>
  <a href="../index.html" class="homeLinkText" title="UIZE JavaScript Framework home">UIZE JavaScript Framework</a>
</h1>

<div class="main">
  <h1 class="document-title">
    <a href="../javascript-examples.html" class="breadcrumb breadcrumbWithArrow">JAVASCRIPT EXAMPLES</a>
    UIZE Unit Tests
    <div class="pageActionsShell">
      <div id="page-actions" class="pageActions"><a href="source-code/uize-unit-tests.html" class="buttonLink">SOURCE</a></div>
    </div>
  </h1>

  <!-- explanation copy -->

  <div class="explanation">
    <p>This example lets you select and run any of the tests of the UIZE JavaScript Framework. Use the test selector to choose your test (an asterisk indicates a minimal load-module-and-build-it test that has been dynamically created because no dedicated test exists for a module). On selecting a test, the test will be loaded dynamically, during which time the <b>"START"</b> and <b>"STOP"</b> buttons will be disabled. After it has loaded, the buttons will be enabled again. Use the <b>"START"</b> button to start running the selected test. While the test is being performed, the progress bar will be updated to show how far you are through the test. Also, the log will be written to with details of the test's progress. You can stop the test at any time using the <b>"STOP"</b> button. If the test fails, test execution will be aborted and a synopsis of the failure will be displayed in a dialog. To run the entire test suite for the UIZE JavaScript Framework, select the <b>"RUN ALL MODULE TESTS"</b> option.</p>
  </div>

  <!-- unit tests UI -->

  <div id="page-unitTests"></div>
</div>

<!-- JavaScript code to make the HTML "come alive" -->

<script type="text/javascript">

Uize.require (
  [
    'UizeSite.Page.Example.library',
    'UizeSite.Page.Example',
    'UizeSite.Widgets.UnitTests.Widget'
  ],
  function () {
    'use strict';

    /*** create the example page widget ***/
      var _page = window.page = UizeSite.Page.Example ();

    /*** add the log widget ***/
      _page.addChild (
        'unitTests',
        UizeSite.Widgets.UnitTests.Widget,
        {
          built:false,
          test:Uize.Url.fromParams (location.href).runtest
        }
      );

    /*** wire up the page widget ***/
      _page.wireUi ();
  }
);

</script>

</body>
</html>