File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -359,17 +359,21 @@ describe('getPropValue', () => {
359
359
} ) ;
360
360
361
361
it ( 'should evaluate to a correct representation of member expression with a nullable member' , ( ) => {
362
- // This tell will not throw when Babel is upgraded from 6 to 7. Remove
363
- // the throw expectation wrapper at that time.
364
- // eslint-disable-next-line no-undef
365
- expect ( ( ) => {
362
+ const runTest = ( ) => {
366
363
const prop = extractProp ( '<div foo={bar?.baz} />' ) ;
367
364
368
365
const expected = 'bar?.baz' ;
369
366
const actual = getPropValue ( prop ) ;
370
367
371
368
assert . equal ( expected , actual ) ;
372
- } ) . toThrow ( ) ;
369
+ } ;
370
+
371
+ if ( fallbackToBabylon ) {
372
+ // eslint-disable-next-line no-undef
373
+ expect ( runTest ) . toThrow ( ) ;
374
+ } else {
375
+ runTest ( ) ;
376
+ }
373
377
} ) ;
374
378
} ) ;
375
379
You can’t perform that action at this time.
0 commit comments