@@ -43,10 +43,12 @@ describe('simulators resource', () => {
4343 } ) ,
4444 } ) ;
4545
46- const result = await simulatorsResource . handler ( mockExecutor ) ;
46+ const result = await simulatorsResource . handler (
47+ new URL ( 'xcodebuildmcp://simulators' ) ,
48+ mockExecutor ,
49+ ) ;
4750
4851 expect ( result . contents ) . toHaveLength ( 1 ) ;
49- expect ( result . contents [ 0 ] . type ) . toBe ( 'text' ) ;
5052 expect ( result . contents [ 0 ] . text ) . toContain ( 'Available iOS Simulators:' ) ;
5153 expect ( result . contents [ 0 ] . text ) . toContain ( 'iPhone 15 Pro' ) ;
5254 expect ( result . contents [ 0 ] . text ) . toContain ( 'ABC123-DEF456-GHI789' ) ;
@@ -59,10 +61,12 @@ describe('simulators resource', () => {
5961 error : 'Command failed' ,
6062 } ) ;
6163
62- const result = await simulatorsResource . handler ( mockExecutor ) ;
64+ const result = await simulatorsResource . handler (
65+ new URL ( 'xcodebuildmcp://simulators' ) ,
66+ mockExecutor ,
67+ ) ;
6368
6469 expect ( result . contents ) . toHaveLength ( 1 ) ;
65- expect ( result . contents [ 0 ] . type ) . toBe ( 'text' ) ;
6670 expect ( result . contents [ 0 ] . text ) . toContain ( 'Failed to list simulators' ) ;
6771 expect ( result . contents [ 0 ] . text ) . toContain ( 'Command failed' ) ;
6872 } ) ;
@@ -73,20 +77,24 @@ describe('simulators resource', () => {
7377 output : 'invalid json' ,
7478 } ) ;
7579
76- const result = await simulatorsResource . handler ( mockExecutor ) ;
80+ const result = await simulatorsResource . handler (
81+ new URL ( 'xcodebuildmcp://simulators' ) ,
82+ mockExecutor ,
83+ ) ;
7784
7885 expect ( result . contents ) . toHaveLength ( 1 ) ;
79- expect ( result . contents [ 0 ] . type ) . toBe ( 'text' ) ;
8086 expect ( result . contents [ 0 ] . text ) . toBe ( 'invalid json' ) ;
8187 } ) ;
8288
8389 it ( 'should handle spawn errors' , async ( ) => {
8490 const mockExecutor = createMockExecutor ( new Error ( 'spawn xcrun ENOENT' ) ) ;
8591
86- const result = await simulatorsResource . handler ( mockExecutor ) ;
92+ const result = await simulatorsResource . handler (
93+ new URL ( 'xcodebuildmcp://simulators' ) ,
94+ mockExecutor ,
95+ ) ;
8796
8897 expect ( result . contents ) . toHaveLength ( 1 ) ;
89- expect ( result . contents [ 0 ] . type ) . toBe ( 'text' ) ;
9098 expect ( result . contents [ 0 ] . text ) . toContain ( 'Failed to list simulators' ) ;
9199 expect ( result . contents [ 0 ] . text ) . toContain ( 'spawn xcrun ENOENT' ) ;
92100 } ) ;
@@ -97,10 +105,12 @@ describe('simulators resource', () => {
97105 output : JSON . stringify ( { devices : { } } ) ,
98106 } ) ;
99107
100- const result = await simulatorsResource . handler ( mockExecutor ) ;
108+ const result = await simulatorsResource . handler (
109+ new URL ( 'xcodebuildmcp://simulators' ) ,
110+ mockExecutor ,
111+ ) ;
101112
102113 expect ( result . contents ) . toHaveLength ( 1 ) ;
103- expect ( result . contents [ 0 ] . type ) . toBe ( 'text' ) ;
104114 expect ( result . contents [ 0 ] . text ) . toContain ( 'Available iOS Simulators:' ) ;
105115 } ) ;
106116
@@ -121,7 +131,10 @@ describe('simulators resource', () => {
121131 } ) ,
122132 } ) ;
123133
124- const result = await simulatorsResource . handler ( mockExecutor ) ;
134+ const result = await simulatorsResource . handler (
135+ new URL ( 'xcodebuildmcp://simulators' ) ,
136+ mockExecutor ,
137+ ) ;
125138
126139 expect ( result . contents [ 0 ] . text ) . toContain ( '[Booted]' ) ;
127140 } ) ;
@@ -149,7 +162,10 @@ describe('simulators resource', () => {
149162 } ) ,
150163 } ) ;
151164
152- const result = await simulatorsResource . handler ( mockExecutor ) ;
165+ const result = await simulatorsResource . handler (
166+ new URL ( 'xcodebuildmcp://simulators' ) ,
167+ mockExecutor ,
168+ ) ;
153169
154170 expect ( result . contents [ 0 ] . text ) . toContain ( 'iPhone 15 Pro' ) ;
155171 expect ( result . contents [ 0 ] . text ) . not . toContain ( 'iPhone 14' ) ;
@@ -172,7 +188,10 @@ describe('simulators resource', () => {
172188 } ) ,
173189 } ) ;
174190
175- const result = await simulatorsResource . handler ( mockExecutor ) ;
191+ const result = await simulatorsResource . handler (
192+ new URL ( 'xcodebuildmcp://simulators' ) ,
193+ mockExecutor ,
194+ ) ;
176195
177196 expect ( result . contents [ 0 ] . text ) . toContain ( 'Next Steps:' ) ;
178197 expect ( result . contents [ 0 ] . text ) . toContain ( 'boot_sim' ) ;
0 commit comments