Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Remove process.emitWarning because it breaks AppVeyor builds
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Aug 18, 2019
1 parent 895e007 commit 8e963c3
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions test/common.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
var warned = false

function testCommon (options) {
var factory = options.factory
var test = options.test
var clear = !!options.clear

if (typeof factory !== 'function') {
throw new TypeError('factory must be a function')
Expand All @@ -13,15 +10,6 @@ function testCommon (options) {
throw new TypeError('test must be a function')
}

if (!clear && !warned) {
warned = true
warn(
'A next major release of abstract-leveldown will make support of ' +
'clear() mandatory. Prepare by enabling the tests and implementing a ' +
'custom _clear() if necessary. See the README for details.'
)
}

return {
test: test,
factory: factory,
Expand All @@ -32,15 +20,7 @@ function testCommon (options) {
errorIfExists: options.errorIfExists !== false,
snapshots: options.snapshots !== false,
seek: options.seek !== false,
clear: clear
}
}

function warn (msg) {
if (typeof process !== 'undefined' && process && process.emitWarning) {
process.emitWarning(msg)
} else if (typeof console !== 'undefined' && console && console.warn) {
console.warn('Warning: ' + msg)
clear: !!options.clear
}
}

Expand Down

0 comments on commit 8e963c3

Please sign in to comment.