chore: add deprecation warning on setting app.allowRendererProcessReuse to false (#22337)
* chore: add deprecation warning on setting app.allowRendererProcessReuse to false * fix: no deprecation warnings in process reuse spec * chore: add test for new deprecate removeProperty behavior
This commit is contained in:
parent
6a01898c76
commit
12c1d4411d
5 changed files with 44 additions and 7 deletions
|
@ -83,6 +83,30 @@ describe('deprecate', () => {
|
|||
expect(msg).to.include(prop)
|
||||
})
|
||||
|
||||
it('deprecates a property of an but retains the existing accessors and setters', () => {
|
||||
let msg
|
||||
deprecate.setHandler(m => { msg = m })
|
||||
|
||||
const prop = 'itMustGo'
|
||||
let i = 1
|
||||
const o = {
|
||||
get itMustGo () {
|
||||
return i
|
||||
},
|
||||
set itMustGo (thing) {
|
||||
i = thing + 1
|
||||
}
|
||||
}
|
||||
|
||||
deprecate.removeProperty(o, prop)
|
||||
|
||||
expect(o[prop]).to.equal(1)
|
||||
expect(msg).to.be.a('string')
|
||||
expect(msg).to.include(prop)
|
||||
o[prop] = 2
|
||||
expect(o[prop]).to.equal(3)
|
||||
})
|
||||
|
||||
it('warns exactly once when a function is deprecated with no replacement', () => {
|
||||
let msg
|
||||
deprecate.setHandler(m => { msg = m })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue