Skip to content

Commit

Permalink
Add test output for browsers.
Browse files Browse the repository at this point in the history
  • Loading branch information
aemkei committed Jan 7, 2013
1 parent d301246 commit a3bfcb9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
var Model = require("./fishbone");
var isBrowser = typeof window != "undefined";

if (!isBrowser){
Model = require("./fishbone");
}

var tests = {
"Class based instance property.": function(){
Expand Down Expand Up @@ -286,6 +290,10 @@ var tests = {
}
};

var log = isBrowser ? function(message){
document.write(message + "<br>");
} : console.log;

for (var description in tests){
console.log(tests[description]() ? "OK" : "ERROR", "-", description);
log((tests[description]() ? "OK" : "ERROR") + " - " + description);
}

0 comments on commit a3bfcb9

Please sign in to comment.