How to use the abstract-leveldown/test.common function in abstract-leveldown

To help you get started, we’ve selected a few abstract-leveldown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Level / leveldown / test / common.js View on Github external
const test = require('tape')
const tempy = require('tempy')
const leveldown = require('..')
const suite = require('abstract-leveldown/test')

module.exports = suite.common({
  test: test,
  factory: function () {
    return leveldown(tempy.directory())
  },

  // Opt-in to new clear() tests
  clear: true
})
github Level / level-js / test / index.js View on Github external
'use strict'

var test = require('tape')
var uuid = require('uuid/v4')
var suite = require('abstract-leveldown/test')
var leveljs = require('..')

// Test feature detection
require('./support-test')(leveljs, test)

var testCommon = suite.common({
  test: test,
  factory: function (opts) {
    return leveljs(uuid(), opts)
  },

  // Unsupported features
  createIfMissing: false,
  errorIfExists: false,
  seek: false,

  // Support of buffer keys depends on environment
  bufferKeys: leveljs(uuid()).supports.bufferKeys,

  // Opt-in to new clear() tests
  clear: true
})