Commit 9cc54f99 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Remove all console.log-s from DocTests.

Class loading failure is now shown in grid.
For other failures the grid also displays the failure message.
parent 2517a4c4
Loading
Loading
Loading
Loading
+20 −5
Original line number Diff line number Diff line
@@ -103,18 +103,33 @@ Ext.define('Docs.controller.DocTests', {
                    });
                }, this);

                this.classesLeft--;
                if (this.classesLeft === 0) {
                    this.getIndex().enable();
                }
                this.countClassLoaded();
            },
            failure: function(response, opts) {
                console.log('Class load failed', cls, url, response, opts);
                this.getIndex().addExample({
                    id: cls,
                    name: cls,
                    href: document.location.href.replace(/#.*/, '#!/api/' + cls),
                    code: 'ClassLoadingFailed();',
                    status: 'failure',
                    message: 'Class loading failed'
                });

                this.countClassLoaded();
            },
            scope: this
        });
    },

    // Counts that yet another class has been loaded.
    // When all loaded, enable the page again.
    countClassLoaded: function() {
        this.classesLeft--;
        if (this.classesLeft === 0) {
            this.getIndex().enable();
        }
    },

    /**
     * Extract example code from html.
     *
+0 −12
Original line number Diff line number Diff line
@@ -248,10 +248,6 @@ Ext.define('Docs.view.doctests.Index', {
        record.commit();
        config.pass++;
        this.showResult(config);

        if (Ext.isDefined(console)) {
            console.log('Test passed: ', record.get('name'));
        }
    },

    /**
@@ -271,13 +267,5 @@ Ext.define('Docs.view.doctests.Index', {
        record.commit();
        config.fail++;
        this.showResult(config);

        if (Ext.isDefined(console)) {
            var stack = 'no stack available';
            if (e.stack) {
                stack = e.stack;
            }
            console.log('Test failure for ' + record.get('name'), e, stack);
        }
    }
});