abstract-leveldown
Advanced tools
Comparing version 6.0.2 to 6.0.3
@@ -145,2 +145,6 @@ var xtend = require('xtend') | ||
if (array.length === 0) { | ||
return process.nextTick(callback) | ||
} | ||
if (typeof options !== 'object' || options === null) options = {} | ||
@@ -147,0 +151,0 @@ |
@@ -5,2 +5,14 @@ # Changelog | ||
## [6.0.3] - 2019-04-26 | ||
### Changed | ||
- Upgrade `nyc` devDependency from `^13.2.0` to `^14.0.0` ([#334](https://github.com/Level/abstract-leveldown/issues/334)) ([**@vweevers**](https://github.com/vweevers)) | ||
### Fixed | ||
- Fix and test asynchronicity of empty batch ([#337](https://github.com/Level/abstract-leveldown/issues/337)) ([**@vweevers**](https://github.com/vweevers)) | ||
- Fix Level badge ([`8993257`](https://github.com/Level/abstract-leveldown/commit/8993257)) ([**@vweevers**](https://github.com/vweevers)) | ||
- Remove link to dead website ([`c0abe28`](https://github.com/Level/abstract-leveldown/commit/c0abe28)) ([**@vweevers**](https://github.com/vweevers)) | ||
## [6.0.2] - 2019-03-30 | ||
@@ -748,4 +760,6 @@ | ||
[unreleased]: https://github.com/level/abstract-leveldown/compare/v6.0.2...HEAD | ||
[unreleased]: https://github.com/level/abstract-leveldown/compare/v6.0.3...HEAD | ||
[6.0.3]: https://github.com/level/abstract-leveldown/compare/v6.0.2...v6.0.3 | ||
[6.0.2]: https://github.com/level/abstract-leveldown/compare/v6.0.1...v6.0.2 | ||
@@ -752,0 +766,0 @@ |
{ | ||
"name": "abstract-leveldown", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"description": "An abstract prototype matching the LevelDOWN API", | ||
@@ -26,3 +26,3 @@ "license": "MIT", | ||
"level-community": "^3.0.0", | ||
"nyc": "^13.2.0", | ||
"nyc": "^14.0.0", | ||
"sinon": "^7.2.4", | ||
@@ -29,0 +29,0 @@ "standard": "^12.0.0", |
@@ -507,3 +507,3 @@ # abstract-leveldown | ||
- Add an awesome badge to your `README`: `![level badge](http://leveldb.org/img/badge.svg)` | ||
- Add an awesome badge to your `README`: `![level badge](https://leveljs.org/img/badge.svg)` | ||
- Publish your awesome module to [npm](https://npmjs.org) | ||
@@ -536,3 +536,3 @@ - Send a Pull Request to [Level/awesome](https://github.com/Level/awesome) to advertise your work! | ||
To sustain [`Level`](https://github.com/Level) and its activities, become a backer or sponsor on [Open Collective](https://opencollective.com/level). Your logo or avatar will be displayed on our 28+ [GitHub repositories](https://github.com/Level), [npm](https://www.npmjs.com/) packages and (soon) [our website](http://leveldb.org). 💖 | ||
To sustain [`Level`](https://github.com/Level) and its activities, become a backer or sponsor on [Open Collective](https://opencollective.com/level). Your logo or avatar will be displayed on our 28+ [GitHub repositories](https://github.com/Level) and [npm](https://www.npmjs.com/) packages. 💖 | ||
@@ -551,3 +551,3 @@ ### Backers | ||
[level-badge]: http://leveldb.org/img/badge.svg | ||
[level-badge]: https://leveljs.org/img/badge.svg | ||
@@ -554,0 +554,0 @@ [encoding-down]: https://github.com/Level/encoding-down |
@@ -196,12 +196,17 @@ var db | ||
}) | ||
} | ||
exports.batch = function (test, testCommon) { | ||
test('test batch() with empty array', function (t) { | ||
var async = false | ||
db.batch([], function (err) { | ||
t.error(err) | ||
t.error(err, 'no error from batch()') | ||
t.ok(async, 'callback is asynchronous') | ||
t.end() | ||
}) | ||
async = true | ||
}) | ||
} | ||
exports.batch = function (test, testCommon) { | ||
test('test simple batch()', function (t) { | ||
@@ -208,0 +213,0 @@ db.batch([{ type: 'put', key: 'foo', value: 'bar' }], function (err) { |
@@ -236,2 +236,14 @@ var collectEntries = require('level-concat-iterator') | ||
}) | ||
test('test batch#write() with no operations', function (t) { | ||
var async = false | ||
db.batch().write(function (err) { | ||
t.ifError(err, 'no error from write()') | ||
t.ok(async, 'callback is asynchronous') | ||
t.end() | ||
}) | ||
async = true | ||
}) | ||
} | ||
@@ -238,0 +250,0 @@ |
@@ -235,3 +235,3 @@ 'use strict' | ||
test('test batch() extensibility', function (t) { | ||
test('test batch([]) (array-form) extensibility', function (t) { | ||
var spy = sinon.spy() | ||
@@ -276,4 +276,22 @@ var expectedCb = function () {} | ||
test('test chained batch() (array) extensibility', function (t) { | ||
test('test batch([]) (array-form) with empty array is asynchronous', function (t) { | ||
var spy = sinon.spy() | ||
var Test = implement(AbstractLevelDOWN, { _batch: spy }) | ||
var test = new Test() | ||
var async = false | ||
test.batch([], function (err) { | ||
t.ifError(err, 'no error') | ||
t.ok(async, 'callback is asynchronous') | ||
// Assert that asynchronicity is provided by batch() rather than _batch() | ||
t.is(spy.callCount, 0, '_batch() call was bypassed') | ||
t.end() | ||
}) | ||
async = true | ||
}) | ||
test('test chained batch() extensibility', function (t) { | ||
var spy = sinon.spy() | ||
var expectedCb = function () {} | ||
@@ -309,2 +327,16 @@ var expectedOptions = { options: 1 } | ||
test('test chained batch() with no operations is asynchronous', function (t) { | ||
var Test = implement(AbstractLevelDOWN, {}) | ||
var test = new Test() | ||
var async = false | ||
test.batch().write(function (err) { | ||
t.ifError(err, 'no error') | ||
t.ok(async, 'callback is asynchronous') | ||
t.end() | ||
}) | ||
async = true | ||
}) | ||
test('test chained batch() (custom _chainedBatch) extensibility', function (t) { | ||
@@ -311,0 +343,0 @@ var spy = sinon.spy() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
194204
3094