beforeEach(function() {

    function genViewHTML(id, view) {
        var html = '';
        html += '<div class="ns-view-' + id + (view.async ? ' ns-async' : '') + '" data-key="' + view.key + '">';
        html += genHTML(view.views);
        html += '</div>';

        return html;
    }

    function genHTML(views) {
        var html = '';
        for (var id in views) {
            var view = views[id];

            // collection
            if (Array.isArray(view)) {
                view.forEach(function(collectionItem) {
                    html += genViewHTML(id, collectionItem);
                });

            } else {
                html += genViewHTML(id, view);
            }

        }
        return html;
    }

    sinon.stub(ns, 'tmpl', function(json) {
        return ns.html2node('<div class="root">' + genHTML(json.views) + '</div>');
    });
});

afterEach(function() {
    ns.tmpl.restore();
});

@@ -192,16 +192,98 @@
 + '%22%3E';%0A
+        // don't create child views in async state%0A        if (!view.async) %7B%0A    
         
@@ -311,16 +311,26 @@
 views);%0A
+        %7D%0A
         

make ns.tmpl stub more compatibale with yate * don't generate child views in async state