refactor: improve function deprecation module (#19012)
* add removeFunction to deprecation module * clarify deprecate api * throw error * change error msg
This commit is contained in:
parent
a90306876e
commit
d79e6bbffe
3 changed files with 18 additions and 5 deletions
|
@ -87,7 +87,7 @@ describe('deprecate', () => {
|
|||
deprecate.setHandler(m => { msg = m })
|
||||
|
||||
function oldFn () { return 'hello' }
|
||||
const deprecatedFn = deprecate.function(oldFn)
|
||||
const deprecatedFn = deprecate.removeFunction(oldFn, 'oldFn')
|
||||
deprecatedFn()
|
||||
|
||||
expect(msg).to.be.a('string')
|
||||
|
@ -100,7 +100,7 @@ describe('deprecate', () => {
|
|||
|
||||
function oldFn () { return 'hello' }
|
||||
function newFn () { return 'goodbye' }
|
||||
const deprecatedFn = deprecate.function(oldFn, newFn)
|
||||
const deprecatedFn = deprecate.renameFunction(oldFn, newFn)
|
||||
deprecatedFn()
|
||||
|
||||
expect(msg).to.be.a('string')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue