View on GitHub

QUnitMetro

The home of the QUnitMetro testing framework

Install from NuGet! Download this project as a .zip file Download this project as a tar.gz file

QUnitMetro Introduction

QUnitMetro is a fork of the excellent QUnit JavaScript testing framework that is redesigned and formatted to work with the Windows 8 Metro UI. With this library, you can write automated unit tests for your JavaScript based Metro apps.

Getting Started

Getting started testing is easy. In your JavaScript application's default.html file, add the following code to setup QUnitMetro references:


    <script src="/js/qunitmetro.js"></script>
    <link href="/css/qunitmetro.css" rel="stylesheet" />

You can optionally add a reference to a stylesheet to format the QUnit report to appear more like your Metro UI:


    <link href="/css/qunitmetro-light.css" rel="stylesheet" />
    <!-- OR -->
    <link href="/css/qunitmetro-dark.css" rel="stylesheet" />

Finally, in those pages that you want to test, add a reference to a script file where you will write your tests. Write a single 'test.js' file in the 'pages' folder of the page you are testing. There is no need to specify this file in any HTML, QUnitMetro will find it and load it appropriately when you navigate to that page in your app.

Tests use the same syntax as the original QUnit

On the pages with tests, you should now be able to click the 'Run Tests' button in the AppBar and see your tests run.