Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add in node and browser interface tests

  • Loading branch information...
commit 22a911aab7cd30bc5fffe2f027df65b56dd56e53 1 parent 2373089
@creationix creationix authored
View
9 test-all.sh
@@ -1,6 +1,11 @@
#!/bin/sh
+cd tests && \
echo "Testing tokenizer..." && \
-node tests/testTokenizer.js && \
+node testTokenizer.js && \
echo "Testing withit..." && \
-node tests/testWithit.js && \
+node testWithit.js && \
+echo "Testing node interface..." && \
+node testNode.js && \
+echo "Testing browser interface..." && \
+phantomjs testBrowser.js && \
echo 'All tests passed!'
View
0  footer.html → tests/footer.html
File renamed without changes
View
1  tests/kernel.js
View
0  tasks.html → tests/tasks.html
File renamed without changes
View
3  test.html → tests/test.html
@@ -78,9 +78,10 @@
if (err) throw err;
if (err) throw err;
document.getElementById('target').innerHTML = result;
+ console.log(result);
});
});
</script>
</body>
-</html>
+</html>
View
27 tests/testBrowser.js
@@ -0,0 +1,27 @@
+#!/usr/bin/env phantomjs
+
+var page = require('webpage').create();
+
+page.onConsoleMessage = function (msg) {
+ console.log(msg);
+};
+
+page.onError = function (msg, trace) {
+ console.log(msg);
+ trace.forEach(function(item) {
+ console.log(' ', item.file, ':', item.line);
+ });
+ phantom.exit(1);
+};
+
+page.onLoadFinished = function (status) {
+ if (status !== "success") {
+ console.log("page.open failed");
+ phantom.exit(2);
+ }
+ console.log("Browser test passed");
+ phantom.exit();
+};
+
+console.log('Loading test page');
+page.open("./test.html");
View
0  test.js → tests/testNode.js
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.