Elvenware UnitTests Guide

Elvenware Logo

TOC

*** tests depend on markup that goes here ***

Using QUnit

{#qunit-banner}

{#qunit-userAgent}

test('readJson', function() {

        $.ajax = function(options) {
            equal(options.url, "MyData.json");
            options.success( { "Result": "Success" } );
        };

        var app = new App();
        app.readJsonTest(function(data) {
            equal(data.Result, 'Success');
            //start();
        }, function(request, ajaxOptions, thrownError) {
            ok(false, 'call to readJson failed: ' + request.responseText);
            //start();
        });
    });