@@ -53,6 +53,18 @@ const expectProjectDirRunUpCommand = (
5353 expect ( command . runUp ) . toBe ( expectedRunUp )
5454 } )
5555
56+ const expectAttachProjectDirCommand = (
57+ args : ReadonlyArray < string > ,
58+ expectedProjectDir : string
59+ ) =>
60+ Effect . sync ( ( ) => {
61+ const command = parseOrThrow ( args )
62+ if ( command . _tag !== "Attach" ) {
63+ throw new Error ( "expected Attach command" )
64+ }
65+ expect ( command . projectDir ) . toBe ( expectedProjectDir )
66+ } )
67+
5668const expectCreateCommand = (
5769 args : ReadonlyArray < string > ,
5870 onRight : ( command : CreateCommand ) => void
@@ -209,22 +221,10 @@ describe("parseArgs", () => {
209221 } ) )
210222
211223 it . effect ( "parses attach with GitHub issue url into issue workspace" , ( ) =>
212- Effect . sync ( ( ) => {
213- const command = parseOrThrow ( [ "attach" , "https://github.com/org/repo/issues/7" ] )
214- if ( command . _tag !== "Attach" ) {
215- throw new Error ( "expected Attach command" )
216- }
217- expect ( command . projectDir ) . toBe ( ".docker-git/org/repo/issue-7" )
218- } ) )
224+ expectAttachProjectDirCommand ( [ "attach" , "https://github.com/org/repo/issues/7" ] , ".docker-git/org/repo/issue-7" ) )
219225
220226 it . effect ( "parses open with GitHub issue url into issue workspace" , ( ) =>
221- Effect . sync ( ( ) => {
222- const command = parseOrThrow ( [ "open" , "https://github.com/org/repo/issues/7" ] )
223- if ( command . _tag !== "Attach" ) {
224- throw new Error ( "expected Attach command" )
225- }
226- expect ( command . projectDir ) . toBe ( ".docker-git/org/repo/issue-7" )
227- } ) )
227+ expectAttachProjectDirCommand ( [ "open" , "https://github.com/org/repo/issues/7" ] , ".docker-git/org/repo/issue-7" ) )
228228
229229 it . effect ( "parses mcp-playwright command in current directory" , ( ) =>
230230 expectProjectDirRunUpCommand ( [ "mcp-playwright" ] , "McpPlaywrightUp" , "." , true ) )
0 commit comments