From 357cb5adcc529866d06fe82755a9370a8121abdc Mon Sep 17 00:00:00 2001 From: Arthur Fiorette Date: Mon, 1 Jul 2024 10:16:45 -0300 Subject: [PATCH] feat: more tests --- src/NodeParser/InterfaceAndClassNodeParser.ts | 2 +- test/valid-data-other.test.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/NodeParser/InterfaceAndClassNodeParser.ts b/src/NodeParser/InterfaceAndClassNodeParser.ts index ca8a715b9..cb8907abd 100644 --- a/src/NodeParser/InterfaceAndClassNodeParser.ts +++ b/src/NodeParser/InterfaceAndClassNodeParser.ts @@ -113,7 +113,7 @@ export class InterfaceAndClassNodeParser implements SubNodeParser { if (ts.isConstructorDeclaration(member)) { const params = member.parameters.filter((param) => ts.isParameterPropertyDeclaration(param, param.parent), - ) as ts.ParameterPropertyDeclaration[]; + ); members.push(...params); } else if (ts.isPropertySignature(member) || ts.isPropertyDeclaration(member)) { members.push(member); diff --git a/test/valid-data-other.test.ts b/test/valid-data-other.test.ts index 2b6ddd181..68a8fa209 100644 --- a/test/valid-data-other.test.ts +++ b/test/valid-data-other.test.ts @@ -46,10 +46,13 @@ describe("valid-data-other", () => { it("generic-simple", assertValidSchema("generic-simple", "*", { expose: "all" })); it("generic-arrays", assertValidSchema("generic-arrays", "MyObject")); it("generic-multiple", assertValidSchema("generic-multiple", "MyObject")); + it("generic-multiple", assertValidSchema("generic-multiple", "*", { expose: "all" })); it("generic-multiargs", assertValidSchema("generic-multiargs", "MyObject")); it("generic-anonymous", assertValidSchema("generic-anonymous", "MyObject")); + it("generic-anonymous", assertValidSchema("generic-anonymous", "*", { expose: "all" })); it("generic-recursive", assertValidSchema("generic-recursive", "MyObject")); it("generic-hell", assertValidSchema("generic-hell", "MyObject")); + it("generic-hell", assertValidSchema("generic-hell", "*", { expose: "all" })); it("generic-default-conditional", assertValidSchema("generic-default-conditional", "MyObject")); it("generic-default", assertValidSchema("generic-default", "MyObject")); it("generic-nested", assertValidSchema("generic-nested", "MyObject"));