Skip to content

Instantly share code, notes, and snippets.

@davidguttman
Created June 18, 2014 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidguttman/684c69c8c2d98d1a2178 to your computer and use it in GitHub Desktop.
Save davidguttman/684c69c8c2d98d1a2178 to your computer and use it in GitHub Desktop.
var test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, DynamoDown = require('../')
testCommon.location = function() {return 'test-table'}
var dynOpts = {
region: 'us-east-1',
secretAccessKey: 'abc',
accessKeyId: '123',
httpOptions: {
proxy: 'http://localhost:8000'
}
}
function leveldown (location) {
var dd = DynamoDown(location)
dd.oldOpen = dd._open
dd._open = function(opts, cb) {
opts.dynamo = dynOpts
return dd.oldOpen(opts, cb)
}
return dd
}
/*** compatibility with basic LevelDOWN API ***/
require('abstract-leveldown/abstract/leveldown-test').args(leveldown, test, testCommon)
require('abstract-leveldown/abstract/open-test').args(leveldown, test, testCommon)
require('abstract-leveldown/abstract/open-test').open(leveldown, test, testCommon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment