@@ -3,7 +3,6 @@ import { PullRequestCommenter } from "@/features/hooks/domain"
33test ( "It adds comment when none exist" , async ( ) => {
44 let didAddComment = false
55 const sut = new PullRequestCommenter ( {
6- domain : "https://example.com" ,
76 siteName : "Demo Docs" ,
87 repositoryNameSuffix : "-openapi" ,
98 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -31,6 +30,7 @@ test("It adds comment when none exist", async () => {
3130 }
3231 } )
3332 await sut . commentPullRequest ( {
33+ hostURL : "https://localhost:3000" ,
3434 appInstallationId : 1234 ,
3535 pullRequestNumber : 42 ,
3636 repositoryOwner : "acme" ,
@@ -44,7 +44,6 @@ test("It adds comment containing list of changed files", async () => {
4444 let didAddComment = false
4545 let commentBody : string | undefined
4646 const sut = new PullRequestCommenter ( {
47- domain : "https://example.com" ,
4847 siteName : "Demo Docs" ,
4948 repositoryNameSuffix : "-openapi" ,
5049 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -76,6 +75,7 @@ test("It adds comment containing list of changed files", async () => {
7675 }
7776 } )
7877 await sut . commentPullRequest ( {
78+ hostURL : "https://localhost:3000" ,
7979 appInstallationId : 1234 ,
8080 pullRequestNumber : 42 ,
8181 repositoryOwner : "acme" ,
@@ -91,7 +91,6 @@ test("It adds comment containing list of changed files", async () => {
9191test ( "It skips adding comment when no YAML files were found in the PR" , async ( ) => {
9292 let didAddComment = false
9393 const sut = new PullRequestCommenter ( {
94- domain : "https://example.com" ,
9594 siteName : "Demo Docs" ,
9695 repositoryNameSuffix : "-openapi" ,
9796 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -119,6 +118,7 @@ test("It skips adding comment when no YAML files were found in the PR", async ()
119118 }
120119 } )
121120 await sut . commentPullRequest ( {
121+ hostURL : "https://localhost:3000" ,
122122 appInstallationId : 1234 ,
123123 pullRequestNumber : 42 ,
124124 repositoryOwner : "acme" ,
@@ -131,7 +131,6 @@ test("It skips adding comment when no YAML files were found in the PR", async ()
131131test ( "It updates comment when one already exists" , async ( ) => {
132132 let didUpdateComment = false
133133 const sut = new PullRequestCommenter ( {
134- domain : "https://example.com" ,
135134 siteName : "Demo Docs" ,
136135 repositoryNameSuffix : "-openapi" ,
137136 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -166,6 +165,7 @@ test("It updates comment when one already exists", async () => {
166165 }
167166 } )
168167 await sut . commentPullRequest ( {
168+ hostURL : "https://localhost:3000" ,
169169 appInstallationId : 1234 ,
170170 pullRequestNumber : 42 ,
171171 repositoryOwner : "acme" ,
@@ -179,7 +179,6 @@ test("It skips updating comment when the body has not changed", async () => {
179179 let addedCommentBody : string | undefined
180180 let didUpdateComment = false
181181 const sut = new PullRequestCommenter ( {
182- domain : "https://example.com" ,
183182 siteName : "Demo Docs" ,
184183 repositoryNameSuffix : "-openapi" ,
185184 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -220,6 +219,7 @@ test("It skips updating comment when the body has not changed", async () => {
220219 } )
221220 // Add a comment.
222221 await sut . commentPullRequest ( {
222+ hostURL : "https://localhost:3000" ,
223223 appInstallationId : 1234 ,
224224 pullRequestNumber : 42 ,
225225 repositoryOwner : "acme" ,
@@ -228,6 +228,7 @@ test("It skips updating comment when the body has not changed", async () => {
228228 } )
229229 // Attempt to update a comment. This is skipped because the body has not changed.
230230 await sut . commentPullRequest ( {
231+ hostURL : "https://localhost:3000" ,
231232 appInstallationId : 1234 ,
232233 pullRequestNumber : 42 ,
233234 repositoryOwner : "acme" ,
@@ -244,7 +245,6 @@ test("It updates comment to remove file list when all relevant file changes were
244245 let addedCommentBody : string | undefined
245246 let updatedCommentBody : string | undefined
246247 const sut = new PullRequestCommenter ( {
247- domain : "https://example.com" ,
248248 siteName : "Demo Docs" ,
249249 repositoryNameSuffix : "-openapi" ,
250250 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -292,6 +292,7 @@ test("It updates comment to remove file list when all relevant file changes were
292292 } )
293293 // Add a comment.
294294 await sut . commentPullRequest ( {
295+ hostURL : "https://localhost:3000" ,
295296 appInstallationId : 1234 ,
296297 pullRequestNumber : 42 ,
297298 repositoryOwner : "acme" ,
@@ -300,6 +301,7 @@ test("It updates comment to remove file list when all relevant file changes were
300301 } )
301302 // Attempt to update a comment. This is skipped because the body has not changed.
302303 await sut . commentPullRequest ( {
304+ hostURL : "https://localhost:3000" ,
303305 appInstallationId : 1234 ,
304306 pullRequestNumber : 42 ,
305307 repositoryOwner : "acme" ,
@@ -318,7 +320,6 @@ test("It adds comment if only project configuration was edited", async () => {
318320 let didAddComment = false
319321 let commentBody : string | undefined
320322 const sut = new PullRequestCommenter ( {
321- domain : "https://example.com" ,
322323 siteName : "Demo Docs" ,
323324 repositoryNameSuffix : "-openapi" ,
324325 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -357,6 +358,7 @@ test("It adds comment if only project configuration was edited", async () => {
357358 }
358359 } )
359360 await sut . commentPullRequest ( {
361+ hostURL : "https://localhost:3000" ,
360362 appInstallationId : 1234 ,
361363 pullRequestNumber : 42 ,
362364 repositoryOwner : "acme" ,
@@ -372,7 +374,6 @@ test("It ignores files starting with a dot", async () => {
372374 let didAddComment = false
373375 let commentBody : string | undefined
374376 const sut = new PullRequestCommenter ( {
375- domain : "https://example.com" ,
376377 siteName : "Demo Docs" ,
377378 repositoryNameSuffix : "-openapi" ,
378379 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -404,6 +405,7 @@ test("It ignores files starting with a dot", async () => {
404405 }
405406 } )
406407 await sut . commentPullRequest ( {
408+ hostURL : "https://localhost:3000" ,
407409 appInstallationId : 1234 ,
408410 pullRequestNumber : 42 ,
409411 repositoryOwner : "acme" ,
@@ -420,7 +422,6 @@ test("It ignores files in directories", async () => {
420422 let didAddComment = false
421423 let commentBody : string | undefined
422424 const sut = new PullRequestCommenter ( {
423- domain : "https://example.com" ,
424425 siteName : "Demo Docs" ,
425426 repositoryNameSuffix : "-openapi" ,
426427 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -452,6 +453,7 @@ test("It ignores files in directories", async () => {
452453 }
453454 } )
454455 await sut . commentPullRequest ( {
456+ hostURL : "https://localhost:3000" ,
455457 appInstallationId : 1234 ,
456458 pullRequestNumber : 42 ,
457459 repositoryOwner : "acme" ,
@@ -467,7 +469,6 @@ test("It ignores files in directories", async () => {
467469test ( "It does not post comment if changes only include ignored filenames" , async ( ) => {
468470 let didAddComment = false
469471 const sut = new PullRequestCommenter ( {
470- domain : "https://example.com" ,
471472 siteName : "Demo Docs" ,
472473 repositoryNameSuffix : "-openapi" ,
473474 projectConfigurationFilename : ".demo-docs.yml" ,
@@ -498,6 +499,7 @@ test("It does not post comment if changes only include ignored filenames", async
498499 }
499500 } )
500501 await sut . commentPullRequest ( {
502+ hostURL : "https://localhost:3000" ,
501503 appInstallationId : 1234 ,
502504 pullRequestNumber : 42 ,
503505 repositoryOwner : "acme" ,
0 commit comments