Skip to content

Instantly share code, notes, and snippets.

@dearfrankg
Created September 11, 2013 23:43
Show Gist options
  • Save dearfrankg/6531334 to your computer and use it in GitHub Desktop.
Save dearfrankg/6531334 to your computer and use it in GitHub Desktop.
pouchdb node module test
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