File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/transformer/descriptor/helper
test/transformer/descriptor/declarations Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,8 @@ export namespace TypescriptHelper {
155155 declarations . find (
156156 ( declaration : ts . Declaration ) =>
157157 ! ts . isVariableDeclaration ( declaration ) &&
158- ! ts . isFunctionDeclaration ( declaration )
158+ ! ts . isFunctionDeclaration ( declaration ) &&
159+ ! ts . isModuleDeclaration ( declaration )
159160 ) || declarations [ 0 ]
160161 ) ;
161162 }
Original file line number Diff line number Diff line change @@ -127,6 +127,23 @@ describe('declarations', () => {
127127 } ) ;
128128 } ) ;
129129
130+ describe ( 'interface and namespace' , ( ) => {
131+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
132+ // @ts -ignore
133+ namespace InterfaceNamespaceTest { }
134+
135+ interface InterfaceNamespaceTest {
136+ value : boolean ;
137+ value2 : string ;
138+ }
139+
140+ it ( 'should ignore the namespace' , ( ) => {
141+ const properties : InterfaceNamespaceTest = createMock < InterfaceNamespaceTest > ( ) ;
142+ expect ( properties . value ) . toBe ( false ) ;
143+ expect ( properties . value2 ) . toBe ( '' ) ;
144+ } ) ;
145+ } ) ;
146+
130147 describe ( 'type' , ( ) => {
131148 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
132149 // @ts -ignore
You can’t perform that action at this time.
0 commit comments