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

Commit

Permalink
feat(report): showFlags option
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreDemailly committed May 28, 2024
1 parent 38985fe commit aa8fa90
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/projects/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export interface ReportConfiguration {
* @default html,pdf
*/
reporters?: ("html" | "pdf")[];
/**
* Show/Hide flags emojis next to packages.
* @default true
*/
showFlags?: boolean;
charts?: ReportChart[];
}

Expand Down
4 changes: 4 additions & 0 deletions src/schema/defs/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
"pdf"
]
},
"showFlags": {
"type": "boolean",
"default": true
},
"charts": {
"type": "array",
"items": {
Expand Down
17 changes: 17 additions & 0 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ describe("JSON Schema", () => {
assert(validate(completeRC));
});

it("showFlags should be true by default", () => {
const withoutshowFlags: Partial<RC.RC> = {
report: {
title: "hello report"
}
};
const ajv = new Ajv({ useDefaults: true });
const validate = ajv.compile(RC.JSONSchema);

const completeRC = merge(
generateDefaultRC("complete"),
withoutshowFlags
);
validate(completeRC);
assert.strictEqual(completeRC.report!.showFlags, true);
});

it("should validate all fixtures configuration", () => {
const ajv = new Ajv();
const validate = ajv.compile(RC.JSONSchema);
Expand Down

0 comments on commit aa8fa90

Please sign in to comment.