diff --git a/cobigen/cobigen-tsplugin/pom.xml b/cobigen/cobigen-tsplugin/pom.xml index 7437ba75f8..ce974c6c28 100644 --- a/cobigen/cobigen-tsplugin/pom.xml +++ b/cobigen/cobigen-tsplugin/pom.xml @@ -2,7 +2,7 @@ 4.0.0 tsplugin CobiGen - TypeScript Plug-in - 2.4.2 + 2.4.3 jar CobiGen - TypeScript Plug-in @@ -15,7 +15,7 @@ ${project.artifactId} nestserver - 1.1.2 + 1.1.5 https\://registry.npmjs.org/@devonfw/cobigen-nestserver/-/cobigen-nestserver-${server.version}.tgz https\://registry.npmjs.org/@devonfw/cobigen-nestserver-linux/-/cobigen-nestserver-linux-${server.version}.tgz https\://registry.npmjs.org/@devonfw/cobigen-nestserver-macos/-/cobigen-nestserver-macos-${server.version}.tgz diff --git a/cobigen/cobigen-tsplugin/src/test/java/com/devonfw/cobigen/tsplugin/merger/TypeScriptMergerTest.java b/cobigen/cobigen-tsplugin/src/test/java/com/devonfw/cobigen/tsplugin/merger/TypeScriptMergerTest.java index 2d4bf74364..496f6a320e 100644 --- a/cobigen/cobigen-tsplugin/src/test/java/com/devonfw/cobigen/tsplugin/merger/TypeScriptMergerTest.java +++ b/cobigen/cobigen-tsplugin/src/test/java/com/devonfw/cobigen/tsplugin/merger/TypeScriptMergerTest.java @@ -186,4 +186,17 @@ private String readTSFile(String fileName) { return returnString; } + /** + * Tests if TypeScript can handle null- and undefined-aware types + * + * @test fails + */ + @Test + public void testNullAndUndefinedTypes() { + TypeScriptMerger tsMerger = new TypeScriptMerger("tsmerge", false); + File baseFile = new File(testFileRootPath + "nullBase.ts"); + String mergedContents = tsMerger.merge(baseFile, readTSFile("nullPatch.ts"), "UTF-8"); + assertEquals(false, mergedContents.contains("Not able to merge") || mergedContents.isEmpty()); + } + } diff --git a/cobigen/cobigen-tsplugin/src/test/resources/testdata/unittest/files/nullBase.ts b/cobigen/cobigen-tsplugin/src/test/resources/testdata/unittest/files/nullBase.ts new file mode 100644 index 0000000000..e754a673e3 --- /dev/null +++ b/cobigen/cobigen-tsplugin/src/test/resources/testdata/unittest/files/nullBase.ts @@ -0,0 +1,4 @@ +export class SomeDataList { + somedataSearchCriteria: SomeDataSearchCriteria = { + }; +} \ No newline at end of file diff --git a/cobigen/cobigen-tsplugin/src/test/resources/testdata/unittest/files/nullPatch.ts b/cobigen/cobigen-tsplugin/src/test/resources/testdata/unittest/files/nullPatch.ts new file mode 100644 index 0000000000..a545a619eb --- /dev/null +++ b/cobigen/cobigen-tsplugin/src/test/resources/testdata/unittest/files/nullPatch.ts @@ -0,0 +1,6 @@ +export class SomeDataList { + somedataSearchCriteria: SomeDataSearchCriteria = { + AnyString: null, + AnotherString: undefined, + }; +} \ No newline at end of file diff --git a/documentation/master-cobigen.asciidoc b/documentation/master-cobigen.asciidoc index 63fbfbfc05..ee96a42fab 100644 --- a/documentation/master-cobigen.asciidoc +++ b/documentation/master-cobigen.asciidoc @@ -14,7 +14,7 @@ This document contains the documentation of the CobiGen core module as well as a * CobiGen v6.1.0 * CobiGen - Java Plug-in v2.2.0 * CobiGen - XML Plug-in v4.2.0 -* CobiGen - TypeScript Plug-in v2.4.2 +* CobiGen - TypeScript Plug-in v2.4.3 * CobiGen - Property Plug-in v2.1.0 * CobiGen - Text Merger v2.1.0 * CobiGen - JSON Plug-in v2.1.0