File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ describe('syntax cases', () => {
11
11
` ) . types . length
12
12
) . not . toEqual ( 0 )
13
13
} )
14
+ it ( 'will extract from app.schema.addToContext' , ( ) => {
15
+ expect (
16
+ extractOrThrow ( `
17
+ app.schema.addToContext(req => ({ a: 1 }))
18
+ ` ) . types . length
19
+ ) . not . toEqual ( 0 )
20
+ } )
14
21
describe ( 'does not extract when not relevant AST pattern' , ( ) => {
15
22
it ( 'case 1' , ( ) => {
16
23
expect (
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ export function extractContextTypes(program: ts.Program): Either<Exception, Extr
90
90
const expText = exp . getExpression ( ) . getText ( )
91
91
const propName = exp . getName ( )
92
92
93
- if ( expText !== 'schema' || propName !== 'addToContext' ) {
93
+ if ( ! ( ( expText === 'schema' || expText === 'app.schema' ) && propName === 'addToContext' ) ) {
94
94
n . forEachChild ( visit )
95
95
return
96
96
}
You can’t perform that action at this time.
0 commit comments