test: build plugins as named objects
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
6 files changed
+107
-63
No files matched your search
@@ -22,8 +22,11 @@ describe('reaching the bus', () => {
|
||||
const fromOutside: string[] = [];
|
||||
const fromPlugin: string[] = [];
|
||||
|
||||
const observer: Plugin = (api) => {
|
||||
api.bus.on('request:end', (e) => fromPlugin.push(e.route ?? ''));
|
||||
const observer: Plugin = {
|
||||
name: 'bus-observer',
|
||||
mount(api) {
|
||||
api.bus.on('request:end', (e) => fromPlugin.push(e.route ?? ''));
|
||||
},
|
||||
};
|
||||
|
||||
@Module({ mountpoint: '/', controllers: [Ctl] })
|
||||
|
||||
Reference in new issue
Block a user