Created
September 11, 2013 23:43
-
-
Save dearfrankg/6531334 to your computer and use it in GitHub Desktop.
pouchdb node module test
This file contains hidden or 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
| chai = require 'chai' | |
| chai.should() | |
| PouchDB = require 'pouchdb' | |
| describe "myPouch", -> | |
| db = null | |
| beforeEach -> | |
| db = new PouchDB 'http://127.0.0.1:5984/ng-db' | |
| console.log 'new' | |
| it 'should list the databases', (done) -> | |
| PouchDB.enableAllDbs = true | |
| PouchDB.allDbs (err, dbs) -> | |
| console.log err, dbs | |
| if (err) then return done(err) | |
| exists = dbs.some (dbname) -> dbname == 'ng-db' | |
| console.log 'exists', exists | |
| exists.should.equal true | |
| done() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment