Skip to content

Commit

Permalink
updated test file to contain required reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Jul 18, 2023
1 parent 3f9e9e7 commit ffcc98e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/runner/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ describe("Config Parsing", () => {
- '.*'
exclude:
- 'example'
type: basic
teams:
- team-example
`);
const config = await runner.getConfigFile("");
expect(config.preventReviewRequests).toBeUndefined();
Expand All @@ -44,6 +47,9 @@ describe("Config Parsing", () => {
condition:
include:
- '${invalidRegex}'
type: basic
teams:
- team-example
`);
await expect(runner.getConfigFile("")).rejects.toThrowError(
`Regular expression is invalid: Include condition '${invalidRegex}' is not a valid regex`,
Expand All @@ -62,6 +68,9 @@ describe("Config Parsing", () => {
- '.*'
exclude:
- 'example'
type: basic
teams:
- team-example
preventReviewRequests:
teams:
Expand All @@ -81,6 +90,9 @@ describe("Config Parsing", () => {
- '.*'
exclude:
- 'example'
type: basic
teams:
- team-example
preventReviewRequests:
users:
Expand Down Expand Up @@ -125,6 +137,9 @@ describe("Config Parsing", () => {
- '.*'
exclude:
- 'example'
type: basic
teams:
- team-example
`);
const config = await runner.getConfigFile("");
expect(config.preventReviewRequests).toBeUndefined();
Expand All @@ -141,6 +156,9 @@ describe("Config Parsing", () => {
- 'example-include-rule-2'
exclude:
- 'example-exclude-rule'
type: basic
teams:
- team-example
`;
it("should parse include conditions", async () => {
api.getConfigFile.mockResolvedValue(exampleConfig);
Expand All @@ -157,6 +175,9 @@ describe("Config Parsing", () => {
condition:
exclude:
- 'example'
type: basic
teams:
- team-example
`);
await expect(runner.getConfigFile("")).rejects.toThrowError('"rules[0].condition.include" is required');
});
Expand All @@ -176,6 +197,9 @@ describe("Config Parsing", () => {
condition:
include:
- '.*'
type: basic
teams:
- team-1
`);
const config = await runner.getConfigFile("");
expect(config.rules[0].condition.exclude).toBeUndefined();
Expand Down

0 comments on commit ffcc98e

Please sign in to comment.