Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

feat: make logoUrl optional #209

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/projects/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/schema/defs/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"type": "object",
"additionalProperties": false,
"required": [
"title",
"logoUrl"
"title"
],
"properties": {
"theme": {
Expand All @@ -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",
Expand Down
20 changes: 19 additions & 1 deletion test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RC.RC> = {
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);

Expand Down