diff --git a/src/NUglify.Tests/JavaScript/Bugs.cs b/src/NUglify.Tests/JavaScript/Bugs.cs index da018f8e..a89f5463 100644 --- a/src/NUglify.Tests/JavaScript/Bugs.cs +++ b/src/NUglify.Tests/JavaScript/Bugs.cs @@ -363,5 +363,19 @@ public void Bug345() { TestHelper.Instance.RunTest("-rename:all"); } + + [Test] + public void Bug346() + { + /************************** + * My TS + * let myArray: Array; AnyDetail() { return myArray?.length > 0 ?? false; } + * conver to JS + **************************/ + var JsCode = "var myArray; function AnyDetail() { var _a; return (_a = (myArray === null || myArray === void 0 ? void 0 : myArray.length) > 0) !== null && _a !== void 0 ? _a : false;}"; + var jsCcodeSettings = new CodeSettings { PreserveFunctionNames = true, TermSemicolons = true, LocalRenaming = LocalRenaming.KeepAll }; + var uglifyResult = Uglify.Js(JsCode, jsCcodeSettings); + Assert.AreEqual(JsCode, uglifyResult.Code); + } } } diff --git a/src/NUglify.Tests/NUglify.Tests.nuget.props b/src/NUglify.Tests/NUglify.Tests.nuget.props index 5929be82..4a5ab7ae 100644 --- a/src/NUglify.Tests/NUglify.Tests.nuget.props +++ b/src/NUglify.Tests/NUglify.Tests.nuget.props @@ -5,17 +5,17 @@ NuGet $(MSBuildThisFileDirectory)project.lock.json $(UserProfile)\.nuget\packages\ - C:\Users\Andrew Bullock\.nuget\packages\ + C:\Users\dev\.nuget\packages\ ProjectJson 5.11.1 - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - C:\Users\Andrew Bullock\.nuget\packages\nunit3testadapter\3.5.0 + C:\Users\dev\.nuget\packages\nunit3testadapter\3.5.0 \ No newline at end of file