
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A test function that:
levelup instance.t, db and createReadStream.db and removes files when a test ends via t.end().db is opened, closed and removed properly.levelup backends via level-test, which also has built in support for MemDOWN. Default is leveldown.t.end and t.ok methods.Extracted from the test code in level-ttl and made more generic.
$ npm install ltest --save
var tape = require('tape')
var test = require('ltest')(tape)
test('put and stream', function (t, db, createReadStream) {
db.put('foo', 'bar', function (err) {
t.ok(!err, 'no put error')
var count = 0
createReadStream()
.on('data', function (data) {
t.equal(data.key, 'foo')
t.equal(data.value, 'bar')
++count
})
.on('end', function () {
t.equal(count, 1)
t.end() // <-- will close the db and delete files
})
})
})
TAP version 13
# put and stream
ok 1 no error on open()
ok 2 valid db object
ok 3 no put error
ok 4 should be equal
ok 5 should be equal
ok 6 should be equal
ok 7 no error on close()
ok 8 db removed
1..8
# tests 8
# pass 8
# ok
ltest([options, ]testFn)Returns a test function of the form function (desc[, opts], cb) where desc is the test description, opts is an optional options object passed to underlying db and cb is a callback of the form function (t, db, createReadStream).
options object is optional and is passed on to levelup and to level-test. Use this to define things like 'keyEncoding' or other settings for levelup.
Set options.mem to true if you want an in memory db.
testFn is the test function that should be used. Use any framework you like as long as it's a function and supports t.end and t.ok methods.
var ltest = require('ltest')(require('tape'))
or
var ltest = require('ltest')(require('tap').test)
MIT
FAQs
test function for leveldb testing
The npm package ltest receives a total of 27 weekly downloads. As such, ltest popularity was classified as not popular.
We found that ltest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.