File tree 1 file changed +13
-12
lines changed
1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,24 @@ export const extractAssertions = (program: Program): Map<Assertion, Set<CallExpr
22
22
node . expression . name :
23
23
node . expression ;
24
24
25
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
26
- const maybeAlias = checker . getSymbolAtLocation ( expression ) ! ;
27
- const symbol = maybeAlias . flags & SymbolFlags . Alias ?
28
- checker . getAliasedSymbol ( maybeAlias ) :
29
- maybeAlias ;
25
+ const maybeAlias = checker . getSymbolAtLocation ( expression ) ;
26
+ if ( maybeAlias ) {
27
+ const symbol = maybeAlias . flags & SymbolFlags . Alias ?
28
+ checker . getAliasedSymbol ( maybeAlias ) :
29
+ maybeAlias ;
30
30
31
- const identifier = symbol . getName ( ) ;
31
+ const identifier = symbol . getName ( ) ;
32
32
33
- // Check if the call type is a valid assertion
34
- if ( assertionFnNames . has ( identifier ) ) {
35
- const assertion = identifier as Assertion ;
33
+ // Check if the call type is a valid assertion
34
+ if ( assertionFnNames . has ( identifier ) ) {
35
+ const assertion = identifier as Assertion ;
36
36
37
- const nodes = assertions . get ( assertion ) ?? new Set < CallExpression > ( ) ;
37
+ const nodes = assertions . get ( assertion ) ?? new Set < CallExpression > ( ) ;
38
38
39
- nodes . add ( node ) ;
39
+ nodes . add ( node ) ;
40
40
41
- assertions . set ( assertion , nodes ) ;
41
+ assertions . set ( assertion , nodes ) ;
42
+ }
42
43
}
43
44
}
44
45
You can’t perform that action at this time.
0 commit comments