Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[0.0.4] Commit for NPM update. - Small fixes.
- Loading branch information
louis
committed
Aug 1, 2012
1 parent
fb787d6
commit 2683468
Showing
5 changed files
with
75 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Yes, I realize these tests are super simple and need to be improved. | ||
Test 1, read example database. | ||
*/ | ||
console.log("Test 1: print from an example database."); | ||
var GistDB = require('./'); | ||
var gdb = new GistDB({id:'9879133ed9dd415d7199'}); | ||
gdb.load(); | ||
gdb.on('loaded',function (data) { | ||
if (this.content.Example0 == "3100.205226801336") { | ||
console.log('Sucessful load.'); | ||
} else { | ||
console.log('Example0 failed.'); | ||
} | ||
console.log('Current data: '+JSON.stringify(this.content)); | ||
runTest2(); | ||
}); | ||
/* | ||
Test 2, no error handler. | ||
*/ | ||
function runTest2 () { | ||
console.log("\nTest 2: No error handler.\n"); | ||
var gdb = new GistDB({user:'USERNAME',pass:'PASSWORD',id:'9879133ed9dd415d7199',timeout:5000}); | ||
gdb.load(); | ||
gdb.on('loaded',function (data) { | ||
console.log('Current data: '+JSON.stringify(data)); | ||
}); | ||
} |