diff --git a/src/projects/report.ts b/src/projects/report.ts index f2c5210..d607711 100644 --- a/src/projects/report.ts +++ b/src/projects/report.ts @@ -12,7 +12,7 @@ export interface ReportConfiguration { /** * URL to a logo to show on the final HTML/PDF Report */ - logoUrl: string; + logoUrl?: string; /** * Show/categorize internal dependencies as transitive * @default false diff --git a/src/schema/defs/report.json b/src/schema/defs/report.json index e959cc7..73f7cdd 100644 --- a/src/schema/defs/report.json +++ b/src/schema/defs/report.json @@ -3,8 +3,7 @@ "type": "object", "additionalProperties": false, "required": [ - "title", - "logoUrl" + "title" ], "properties": { "theme": { @@ -23,7 +22,7 @@ "logoUrl": { "type": "string", "description": "Logo", - "default": "https://avatars0.githubusercontent.com/u/29552883?s=200&v=4" + "nullable": true }, "includeTransitiveInternal": { "type": "boolean", diff --git a/test/index.spec.ts b/test/index.spec.ts index 388ff31..d49cfa2 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -47,7 +47,25 @@ describe("JSON Schema", () => { assert(!validate({ foo: "bar" })); }); - it("should validate all fixtures configuration", async() => { + it("logoUrl should be optional", () => { + const withoutLogoUrl: Partial = { + report: { + title: "hello report" + } + }; + const ajv = new Ajv(); + const validate = ajv.compile(RC.JSONSchema); + + assert(validate(generateDefaultRC())); + + const completeRC = merge( + generateDefaultRC("complete"), + withoutLogoUrl + ); + assert(validate(completeRC)); + }); + + it("should validate all fixtures configuration", () => { const ajv = new Ajv(); const validate = ajv.compile(RC.JSONSchema);