Skip to content

Commit

Permalink
test: use pouchdb-memory instead of full pouchdb
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Sep 1, 2016
1 parent 5976181 commit 810cbaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
10 changes: 2 additions & 8 deletions tests/specs/find-or-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,13 @@ test('#58 store.findOrAdd([object1, object2]) triggers no events when finds exis
test('findOrAdd() as required by end user', function (t) {
t.plan(5)

var PouchDB = process.browser ? global.PouchDB : require('pouchdb')
var PouchDB = process.browser ? global.PouchDB : require('pouchdb-memory')

PouchDB.plugin({
findOrAdd: require('../../find-or-add')
})

var options = process.browser ? {
adapter: 'memory'
} : {
db: require('memdown')
}

var db = new PouchDB('db-findOrAdd-as-required', options)
var db = new PouchDB('db-findOrAdd-as-required')

t.isNot(PouchDB.prototype.findOrAdd, 'undefined', 'check findOrAdd plugin is active')

Expand Down
10 changes: 2 additions & 8 deletions tests/utils/db.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
'use strict'

var PouchDB = process.browser ? global.PouchDB : require('pouchdb')
var PouchDB = process.browser ? global.PouchDB : require('pouchdb-memory')

if (!PouchDB.prototype.hoodieApi) {
PouchDB.plugin(require('../../'))
}

var options = process.browser ? {
adapter: 'memory'
} : {
db: require('memdown')
}

module.exports = function () {
return new PouchDB(uniqueName(), options)
return new PouchDB(uniqueName())
}

var uniqueNr = 0
Expand Down

0 comments on commit 810cbaa

Please sign in to comment.