diff --git a/openrewrite/test/javascript/parser/typeLiteral.test.ts b/openrewrite/test/javascript/parser/typeLiteral.test.ts index bd8a041..6854c43 100644 --- a/openrewrite/test/javascript/parser/typeLiteral.test.ts +++ b/openrewrite/test/javascript/parser/typeLiteral.test.ts @@ -36,6 +36,20 @@ describe('type literal mapping', () => { `) ); }); + test('null save access ?.', () => { + rewriteRun( + //language=typescript + typeScript(` + const array: Array = null; + console.log(array.length); + `), + //language=typescript + typeScript(` + const array: Array = null; + console.log(array?.length); + `) + ); + }); test('type literal', () => { rewriteRun(