Fix & regression test for issue 363: Calling setSelection() after an updateOptions...
[dygraphs.git] / auto_tests / misc / fake-jstestdriver.js
index 92147ca..6f4f464 100644 (file)
@@ -27,6 +27,14 @@ var jstestdriver = {
   jQuery : jQuery
 };
 
+if (!console) {
+  var console = {
+    log: function(x) {
+      // ...
+    }
+  };
+}
+
 var jstd = {
   include : function(name) {
     this.sucker("Not including " + name);
@@ -84,17 +92,18 @@ function TestCase(name) {
       return false;
     }
   };
+
   testCase.prototype.runAllTests = function() {
-    // what's better than for ... in for non-array objects?
-    var tests = {};
+    var results = {};
     var names = this.getTestNames();
     for (var idx in names) {
       var name = names[idx];
       console.log("Running " + name);
       var result = this.runTest(name);
-      tests[name] = result;
+      results[name] = result;
     }
-    console.log(prettyPrintEntity_(tests));
+    console.log(prettyPrintEntity_(results));
+    return results;
   };
 
   testCase.prototype.getTestNames = function() {