Commit a3ca4dc6 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Override alert() during test runs to avoid popups.

parent dfbe6317
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -151,11 +151,15 @@ Ext.define('Docs.view.doctests.Index', {
        var options = record.get('options');
        options.preview = false; // always disable the preview option

        // Override alert() with empty function, so we don't get
        // disturbing popups during test runs.
        var safeAlert = "var alert = function(){};\n";

        var example = testRunner.add(
            Ext.create('Docs.view.examples.Inline', {
                cls: 'doc-test-preview',
                height: 0,
                value: record.get('code'),
                value: safeAlert + record.get('code'),
                options: options
            })
        );