@@ -163,37 +163,37 @@ describe('removed-apis transform', () => {
163163 } ) ;
164164 } ) ;
165165
166- describe ( 'StreamableHTTPError → SdkError ' , ( ) => {
167- it ( 'renames StreamableHTTPError to SdkError in references' , ( ) => {
166+ describe ( 'StreamableHTTPError → SdkHttpError ' , ( ) => {
167+ it ( 'renames StreamableHTTPError to SdkHttpError in references' , ( ) => {
168168 const input = [
169169 `import { StreamableHTTPError } from '@modelcontextprotocol/client';` ,
170170 `if (error instanceof StreamableHTTPError) { throw error; }` ,
171171 ''
172172 ] . join ( '\n' ) ;
173173 const { text } = applyTransform ( input ) ;
174- expect ( text ) . toContain ( 'instanceof SdkError ' ) ;
174+ expect ( text ) . toContain ( 'instanceof SdkHttpError ' ) ;
175175 expect ( text ) . not . toContain ( 'StreamableHTTPError' ) ;
176176 } ) ;
177177
178- it ( 'adds SdkError import without SdkErrorCode when no constructor calls' , ( ) => {
178+ it ( 'adds SdkHttpError import without SdkErrorCode when no constructor calls' , ( ) => {
179179 const input = [
180180 `import { StreamableHTTPError } from '@modelcontextprotocol/client';` ,
181181 `if (error instanceof StreamableHTTPError) {}` ,
182182 ''
183183 ] . join ( '\n' ) ;
184184 const { text } = applyTransform ( input ) ;
185- expect ( text ) . toContain ( 'SdkError ' ) ;
185+ expect ( text ) . toContain ( 'SdkHttpError ' ) ;
186186 expect ( text ) . not . toContain ( 'SdkErrorCode' ) ;
187187 } ) ;
188188
189- it ( 'adds SdkError and SdkErrorCode imports when constructor calls exist' , ( ) => {
189+ it ( 'adds SdkHttpError and SdkErrorCode imports when constructor calls exist' , ( ) => {
190190 const input = [
191191 `import { StreamableHTTPError } from '@modelcontextprotocol/client';` ,
192192 `throw new StreamableHTTPError(404, 'Not Found');` ,
193193 ''
194194 ] . join ( '\n' ) ;
195195 const { text } = applyTransform ( input ) ;
196- expect ( text ) . toContain ( 'SdkError ' ) ;
196+ expect ( text ) . toContain ( 'SdkHttpError ' ) ;
197197 expect ( text ) . toContain ( 'SdkErrorCode' ) ;
198198 } ) ;
199199
@@ -208,14 +208,14 @@ describe('removed-apis transform', () => {
208208 expect ( constructorWarning ) . toBeDefined ( ) ;
209209 } ) ;
210210
211- it ( 'emits general migration warning' , ( ) => {
211+ it ( 'emits general migration warning pointing at the typed status accessor ' , ( ) => {
212212 const input = [
213213 `import { StreamableHTTPError } from '@modelcontextprotocol/client';` ,
214214 `if (error instanceof StreamableHTTPError) {}` ,
215215 ''
216216 ] . join ( '\n' ) ;
217217 const { result } = applyTransform ( input ) ;
218- const migrationWarning = result . diagnostics . find ( d => d . message . includes ( 'error.data?. status' ) ) ;
218+ const migrationWarning = result . diagnostics . find ( d => d . message . includes ( 'error.status' ) ) ;
219219 expect ( migrationWarning ) . toBeDefined ( ) ;
220220 } ) ;
221221
@@ -227,7 +227,7 @@ describe('removed-apis transform', () => {
227227 ] . join ( '\n' ) ;
228228 const { text } = applyTransform ( input ) ;
229229 expect ( text ) . not . toContain ( 'import { StreamableHTTPError }' ) ;
230- expect ( text ) . toMatch ( / i m p o r t .* S d k E r r o r / ) ;
230+ expect ( text ) . toMatch ( / i m p o r t .* S d k H t t p E r r o r / ) ;
231231 } ) ;
232232
233233 it ( 'is idempotent' , ( ) => {
@@ -249,9 +249,9 @@ describe('removed-apis transform', () => {
249249 ''
250250 ] . join ( '\n' ) ;
251251 const { text, result } = applyTransform ( input ) ;
252- expect ( text ) . toContain ( 'instanceof SdkError ' ) ;
252+ expect ( text ) . toContain ( 'instanceof SdkHttpError ' ) ;
253253 expect ( text ) . not . toMatch ( / \b S H E \b / ) ;
254- expect ( text ) . toMatch ( / i m p o r t .* S d k E r r o r / ) ;
254+ expect ( text ) . toMatch ( / i m p o r t .* S d k H t t p E r r o r / ) ;
255255 const constructorWarning = result . diagnostics . find ( d => d . message . includes ( 'Constructor arguments differ' ) ) ;
256256 expect ( constructorWarning ) . toBeDefined ( ) ;
257257 } ) ;
0 commit comments