Skip to content

Commit

Permalink
feat: Add benchmark scope (#7)
Browse files Browse the repository at this point in the history
* feat: Add benchmark scope

The benchmark scope is meant for the benchmark cli.

* Add test for valid scopes
  • Loading branch information
tomi authored Sep 2, 2024
1 parent 5912a17 commit 8e0184e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const TYPES = [
"ci",
];

const SCOPES = ["API", "core", "editor"];
const SCOPES = ["API", "core", "editor", "benchmark"];

const displayTypes = TYPES.map((type) => `\`${type}\``).join(", ");
const displayScopes = SCOPES.map((type) => `\`${type}\``).join(", ");
Expand Down
10 changes: 9 additions & 1 deletion src/validatePrTitle.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { validatePrTitle: validate } = require("./validatePrTitle");
const { ERRORS, NO_CHANGELOG } = require("./constants");
const { ERRORS, NO_CHANGELOG, SCOPES } = require("./constants");
const displayNamesModule = require("./getAllNodesDisplayNames");
const { TYPES } = require("./constants");
const {
Expand Down Expand Up @@ -98,6 +98,14 @@ describe("scope", () => {
.toHaveLength(1)
.toContain(ERRORS.INVALID_SCOPE + ". Did you mean `Gmail Trigger Node`?");
});

test.each(SCOPES)(
'Validation should pass for valid scope "%s"',
async (scope) => {
const issues = await validate(`feat(${scope}): Implement feature`);
expect(issues).toHaveLength(0);
},
);
});

describe("subject", () => {
Expand Down

0 comments on commit 8e0184e

Please sign in to comment.