chore: fix promisify helper (#16544)

* chore: fix promise deprecation helper

* fix deprecations

* update deprecation tests
This commit is contained in:
Shelley Vohr 2019-01-25 14:23:24 -08:00 committed by GitHub
parent 63bf370cc0
commit 5a35c3a279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 65 additions and 48 deletions

View file

@ -138,7 +138,7 @@ describe('deprecations', () => {
it('acts as a pass-through for promise-based invocations', async () => {
enableCallbackWarnings()
promiseFunc = deprecate.promisify(promiseFunc, 1)
promiseFunc = deprecate.promisify(promiseFunc)
const actual = await promiseFunc(expected)
expect(actual).to.equal(expected)
@ -147,12 +147,11 @@ describe('deprecations', () => {
it('warns exactly once for callback-based invocations', (done) => {
enableCallbackWarnings()
promiseFunc = deprecate.promisify(promiseFunc, 1)
promiseFunc = deprecate.promisify(promiseFunc)
let callbackCount = 0
const invocationCount = 3
const callback = (error, actual) => {
expect(error).to.be.null()
const callback = (actual) => {
expect(actual).to.equal(expected)
expect(warnings).to.have.lengthOf(1)
expect(warnings[0]).to.include('promiseFunc')