mirror of
https://github.com/feathersjs/feathers.git
synced 2026-01-25 15:23:13 +00:00
fix: Add registerPublisher method to protected method list
This commit is contained in:
parent
9a11776aa2
commit
2c0664acf9
@ -170,6 +170,15 @@ describe('Feathers application', () => {
|
||||
message: "'teardown' on service 'dummy' is not allowed as a custom method name"
|
||||
}
|
||||
)
|
||||
assert.throws(
|
||||
() =>
|
||||
feathers().use('/dummy', dummyService, {
|
||||
methods: ['create', 'registerPublisher']
|
||||
}),
|
||||
{
|
||||
message: "'registerPublisher' on service 'dummy' is not allowed as a custom method name"
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
it('can register service with no external methods', async () => {
|
||||
|
||||
@ -25,7 +25,18 @@ export const defaultServiceEvents = Object.values(defaultEventMap)
|
||||
|
||||
export const protectedMethods = Object.keys(Object.prototype)
|
||||
.concat(Object.keys(EventEmitter.prototype))
|
||||
.concat(['all', 'around', 'before', 'after', 'error', 'hooks', 'setup', 'teardown', 'publish'])
|
||||
.concat([
|
||||
'all',
|
||||
'around',
|
||||
'before',
|
||||
'after',
|
||||
'error',
|
||||
'hooks',
|
||||
'setup',
|
||||
'teardown',
|
||||
'publish',
|
||||
'registerPublisher'
|
||||
])
|
||||
|
||||
export const protectedProperties = protectedMethods.concat(['service', 'events', 'id'])
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user