summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-09-28 17:39:41 +0300
committerAlon Levy <alon@pobox.com>2014-09-28 17:39:41 +0300
commit5c79414e6398b6f789b365b78c05e547cc5d08d1 (patch)
treecb0ed443dddef326ea20cb591e682dd9f244c0e3
parent68897a7a240b71b44e6664b563acdf15757a78f5 (diff)
add jsdom based test - not actually history test yet, just calls textAnalyser2
-rw-r--r--tests/test_history.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/test_history.js b/tests/test_history.js
new file mode 100644
index 00000000..1457f3d1
--- /dev/null
+++ b/tests/test_history.js
@@ -0,0 +1,44 @@
+var fs = require('fs'),
+ jsdom = require('jsdom');
+
+var script_filenames = [
+ "d3/d3.v3.min.js",
+ "scripts/jquery.js",
+ "external/jquery-ui.js",
+ "scripts/caret.js",
+
+ "scripts/autocomplete.js",
+ "scripts/history.js",
+ "scripts/rhizicore.js",
+ "scripts/textanalysis.js",
+ "scripts/textanalysis-ui.js",
+ "scripts/buttons.js",
+ "scripts/drag_n_drop.js",
+ "scripts/robot.js",
+ "scripts/watchdog.js",
+ "scripts/gant.js"].map(function(x) { return "../" + x; });
+
+//var scripts = script_filenames.map(function (x) { console.log('reading ' + x); return fs.readFileSync(x); });
+
+var typein = function(window, text) {
+ var c;
+
+ for(c in text) {
+ console.log(c);
+ }
+}
+
+var env = jsdom.env({
+ //src: scripts,
+ scripts: script_filenames,
+ //url: "http://localhost:12345/",
+ html: "<html><body></body></html>",
+ done: function (errors, window) {
+ console.log('---------');
+ console.log(errors);
+ console.log('---------');
+ //typein(window, "#a is #b|");
+ console.log(window.textAnalyser2("#a"));
+ process.exit();
+ }
+});