easily run your level-* tests across all leveldown backends.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
browser.js
index.js
package.json

README.md

level-test

inject different level implementations (browser, leveldb, etc) into your tests.

travis

testling

Example

Create a fresh db, with out refering to any fs or dom specifics, so that the same test can be used in the server or the browser!

var level = require('level-test')()
var db = level('foo', { encoding: 'json' })

In Memory Example

var level = require('level-test')( { mem: true })
var db = level('foo', { encoding: 'json' })

Use whatever test framework you like!

Custom Backends

A custom backend for levelup can be provided via the options object:

var hyper = require('leveldown-hyper')
var level = require('level-test')( { db: hyper })
var db = level('foo', { encoding: 'json' })

Options

Currently supported options:

level(name, {
  clean: false, // do not delete database (defaults to true)
  db: require('leveldown-hyper') // optional, defaults to leveldown
})

TODO

configure leveldb settings via command line options/enviroment vars.

License

MIT