random-access-test
random-access-storage compliance test suite.
npm install --save --dev random-access-test
This module provides set of generic tests to verify API compatibility.
Usage
var test = require("random-access-test")
var randomAccess = require("random-access-file")
var path = require("path")
var tmp = path.join(
os.tmpdir(),
"random-access-file-" + process.pid + "-" + Date.now()
)
test(
function(name, options, callback) {
const file = path.join(tmp, name)
callback(randomAccess(file, options))
},
{
reopen: true,
content: false,
del: true,
writable: true,
size: true,
truncate: true
}
)
License
MIT