@@ -65,11 +65,7 @@ describe('spec-schema-access transform', () => {
6565 } ) ;
6666
6767 it ( 'adds specTypeSchemas import' , ( ) => {
68- const input = [
69- `import { ToolSchema } from '@modelcontextprotocol/server';` ,
70- `const s = ToolSchema;` ,
71- ''
72- ] . join ( '\n' ) ;
68+ const input = [ `import { ToolSchema } from '@modelcontextprotocol/server';` , `const s = ToolSchema;` , '' ] . join ( '\n' ) ;
7369 const { text } = applyTransform ( input ) ;
7470 expect ( text ) . toContain ( 'specTypeSchemas.Tool' ) ;
7571 expect ( text ) . toMatch ( / i m p o r t .* s p e c T y p e S c h e m a s .* f r o m / ) ;
@@ -93,11 +89,9 @@ describe('spec-schema-access transform', () => {
9389
9490 describe ( 'diagnostic only: .parse(v)' , ( ) => {
9591 it ( 'emits diagnostic for parse usage' , ( ) => {
96- const input = [
97- `import { ToolSchema } from '@modelcontextprotocol/server';` ,
98- `const tool = ToolSchema.parse(raw);` ,
99- ''
100- ] . join ( '\n' ) ;
92+ const input = [ `import { ToolSchema } from '@modelcontextprotocol/server';` , `const tool = ToolSchema.parse(raw);` , '' ] . join (
93+ '\n'
94+ ) ;
10195 const { text, result } = applyTransform ( input ) ;
10296 expect ( text ) . toContain ( 'ToolSchema.parse' ) ;
10397 expect ( result . changesCount ) . toBe ( 0 ) ;
@@ -121,34 +115,25 @@ describe('spec-schema-access transform', () => {
121115
122116 describe ( 'no-op cases' , ( ) => {
123117 it ( 'does nothing for non-MCP imports' , ( ) => {
124- const input = [
125- `import { CallToolRequestSchema } from './local';` ,
126- `CallToolRequestSchema.safeParse(data);` ,
127- ''
128- ] . join ( '\n' ) ;
118+ const input = [ `import { CallToolRequestSchema } from './local';` , `CallToolRequestSchema.safeParse(data);` , '' ] . join ( '\n' ) ;
129119 const { text, result } = applyTransform ( input ) ;
130120 expect ( text ) . toContain ( 'CallToolRequestSchema.safeParse' ) ;
131121 expect ( result . changesCount ) . toBe ( 0 ) ;
132122 expect ( result . diagnostics . length ) . toBe ( 0 ) ;
133123 } ) ;
134124
135125 it ( 'does nothing for non-spec schema names' , ( ) => {
136- const input = [
137- `import { SomeRandomSchema } from '@modelcontextprotocol/server';` ,
138- `SomeRandomSchema.parse(data);` ,
139- ''
140- ] . join ( '\n' ) ;
126+ const input = [ `import { SomeRandomSchema } from '@modelcontextprotocol/server';` , `SomeRandomSchema.parse(data);` , '' ] . join (
127+ '\n'
128+ ) ;
141129 const { text, result } = applyTransform ( input ) ;
142130 expect ( text ) . toContain ( 'SomeRandomSchema.parse' ) ;
143131 expect ( result . changesCount ) . toBe ( 0 ) ;
144132 expect ( result . diagnostics . length ) . toBe ( 0 ) ;
145133 } ) ;
146134
147135 it ( 'does nothing when no remaining references' , ( ) => {
148- const input = [
149- `import { CallToolRequestSchema } from '@modelcontextprotocol/server';` ,
150- ''
151- ] . join ( '\n' ) ;
136+ const input = [ `import { CallToolRequestSchema } from '@modelcontextprotocol/server';` , '' ] . join ( '\n' ) ;
152137 const { result } = applyTransform ( input ) ;
153138 expect ( result . changesCount ) . toBe ( 0 ) ;
154139 expect ( result . diagnostics . length ) . toBe ( 0 ) ;
0 commit comments