Skip to content

Commit 4729b9f

Browse files
authored
fix: don't raise errors when pact has no interactions (#112)
1 parent 1ff5c7f commit 4729b9f

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

src/__tests__/fixtures/no-pacts-found/oas.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,4 @@ info:
33
title: OAS
44
version: 1.0.0
55

6-
paths:
7-
/exists:
8-
get:
9-
responses:
10-
"200":
11-
description: description
12-
content:
13-
"application/json":
14-
schema: {}
6+
paths: {}
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
[
2-
{
3-
"code": "pact-broker.no-pacts-found",
4-
"message": "No consumer pacts found in Pact Broker",
5-
"type": "warning"
6-
}
7-
]
1+
[]

src/compare/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ export class Comparator {
6262

6363
const parsedPact = parsePact(pact);
6464

65-
if (parsedPact.interactions.length === 0) {
66-
yield {
67-
code: "pact-broker.no-pacts-found",
68-
message: "No consumer pacts found in Pact Broker",
69-
type: "warning",
70-
};
71-
}
72-
7365
for (const [index, interaction] of parsedPact.interactions.entries()) {
7466
const { method, path, query } = interaction.request;
7567
let pathWithLeadingSlash = path.startsWith("/") ? path : `/${path}`;

0 commit comments

Comments
 (0)