File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/code-export-utils Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,16 @@ describe('Hooks', () => {
6262 ] ,
6363 } )
6464 } )
65- it ( 'should allow for checking if a command is already registered' , ( ) => {
65+ it ( 'should check if a command is already registered' , ( ) => {
6666 const hook = new Hook ( )
6767 hook . register ( ( ) => {
6868 return 'blah'
6969 } )
70+ hook . register ( ( ) => {
71+ return 1234
72+ } )
7073 expect ( hook . isRegistered ( 'blah' ) ) . resolves . toBeTruthy ( )
74+ expect ( hook . isRegistered ( 1234 ) ) . resolves . toBeTruthy ( )
7175 expect ( hook . isRegistered ( 'halb' ) ) . resolves . toBeFalsy ( )
7276 } )
7377} )
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export default class Hook {
8383
8484 async isRegistered ( input = '' ) {
8585 const result = await Promise . all ( this . emitters . map ( emitter => emitter ( ) ) )
86- return result . map ( command => command . includes ( input ) ) . includes ( true )
86+ return result . includes ( input )
8787 }
8888}
8989
You can’t perform that action at this time.
0 commit comments