From 5c79414e6398b6f789b365b78c05e547cc5d08d1 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 28 Sep 2014 17:39:41 +0300 Subject: add jsdom based test - not actually history test yet, just calls textAnalyser2 --- tests/test_history.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/test_history.js (limited to 'tests') 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: "", + done: function (errors, window) { + console.log('---------'); + console.log(errors); + console.log('---------'); + //typein(window, "#a is #b|"); + console.log(window.textAnalyser2("#a")); + process.exit(); + } +}); -- cgit v1.3.1