level-test-sync

1.6.11 • Public • Published

level-test-sync

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!

options

currently supported options:

level(name, {
  clean: false //do not delete database (defaults to true)
})
 

TODO

configure leveldb settings via command line options/enviroment vars.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i level-test-sync

Weekly Downloads

1

Version

1.6.11

License

MIT

Last publish

Collaborators

  • riceball