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

@ -266,12 +266,13 @@ describe('session module', () => {
}
expect(error).to.be.undefined(error)
})
it('with callbacks', (done) => {
const name = 'foo'
const value = 'bar'
const { cookies } = session.defaultSession
cookies.set({ url, name, value }, error => {
cookies.set({ url, name, value }, (error) => {
if (error) return done(error)
cookies.flushStore(error => done(error))
})
@ -279,6 +280,19 @@ describe('session module', () => {
})
})
describe('ses.cookies.flushStore(callback)', () => {
it('flushes the cookies to disk and invokes the callback when done', (done) => {
session.defaultSession.cookies.set({
url: url,
name: 'foo',
value: 'bar'
}, (error) => {
if (error) return done(error)
session.defaultSession.cookies.flushStore(() => done())
})
})
})
it('should survive an app restart for persistent partition', async () => {
const appPath = path.join(__dirname, 'fixtures', 'api', 'cookie-app')
const electronPath = remote.getGlobal('process').execPath
@ -735,7 +749,7 @@ describe('session module', () => {
})
})
describe('ses.setCertificateVerifyProc(callback)', () => {
describe('ses.setCertificateVerifyProc(callback)', (done) => {
let server = null
beforeEach((done) => {