Skip to content

Commit 11cdd28

Browse files
committed
fix: update tests for Prettier, Zod v4, and @mcp-ui/server v6.1.0 upgrades
- Reformat dynamic imports to match Prettier 3.8.x style - Update Zod v4 error code assertions (invalid_value, too_big) - Update mimeType assertions for @mcp-ui/server v6.1.0 (text/html;profile=mcp-app) - Fix PreviewStyleTool test mimeType expectation
1 parent ae133cf commit 11cdd28

7 files changed

Lines changed: 16 additions & 23 deletions

File tree

test/tools/create-token-tool/CreateTokenTool.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ describe('CreateTokenTool', () => {
4444
});
4545

4646
it('should have correct input schema', async () => {
47-
const { CreateTokenSchema } = await import(
48-
'../../../src/tools/create-token-tool/CreateTokenTool.input.schema.js'
49-
);
47+
const { CreateTokenSchema } =
48+
await import('../../../src/tools/create-token-tool/CreateTokenTool.input.schema.js');
5049
expect(CreateTokenSchema).toBeDefined();
5150
});
5251
});

test/tools/delete-style-tool/DeleteStyleTool.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ describe('DeleteStyleTool', () => {
2929
});
3030

3131
it('should have correct input schema', async () => {
32-
const { DeleteStyleSchema } = await import(
33-
'../../../src/tools/delete-style-tool/DeleteStyleTool.input.schema.js'
34-
);
32+
const { DeleteStyleSchema } =
33+
await import('../../../src/tools/delete-style-tool/DeleteStyleTool.input.schema.js');
3534
expect(DeleteStyleSchema).toBeDefined();
3635
});
3736
});

test/tools/list-styles-tool/ListStylesTool.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ describe('ListStylesTool', () => {
3030
});
3131

3232
it('should have correct input schema', async () => {
33-
const { ListStylesSchema } = await import(
34-
'../../../src/tools/list-styles-tool/ListStylesTool.input.schema.js'
35-
);
33+
const { ListStylesSchema } =
34+
await import('../../../src/tools/list-styles-tool/ListStylesTool.input.schema.js');
3635
expect(ListStylesSchema).toBeDefined();
3736
});
3837
});

test/tools/list-tokens-tool/ListTokensTool.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ describe('ListTokensTool', () => {
4343
});
4444

4545
it('should have correct input schema', async () => {
46-
const { ListTokensSchema } = await import(
47-
'../../../src/tools/list-tokens-tool/ListTokensTool.input.schema.js'
48-
);
46+
const { ListTokensSchema } =
47+
await import('../../../src/tools/list-tokens-tool/ListTokensTool.input.schema.js');
4948
expect(ListTokensSchema).toBeDefined();
5049
});
5150
});
@@ -59,7 +58,7 @@ describe('ListTokensTool', () => {
5958
expect(result.isError).toBe(true);
6059
expect(result.content[0]).toHaveProperty('type', 'text');
6160
const errorText = (result.content[0] as TextContent).text;
62-
expect(errorText).toContain('<=100');
61+
expect(errorText).toContain('too_big');
6362
});
6463

6564
it('validates sortby enum values', async () => {

test/tools/preview-style-tool/PreviewStyleTool.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ describe('PreviewStyleTool', () => {
2121
});
2222

2323
it('should have correct input schema', async () => {
24-
const { PreviewStyleSchema } = await import(
25-
'../../../src/tools/preview-style-tool/PreviewStyleTool.input.schema.js'
26-
);
24+
const { PreviewStyleSchema } =
25+
await import('../../../src/tools/preview-style-tool/PreviewStyleTool.input.schema.js');
2726
expect(PreviewStyleSchema).toBeDefined();
2827
});
2928
});
@@ -166,7 +165,7 @@ describe('PreviewStyleTool', () => {
166165
type: 'resource',
167166
resource: {
168167
uri: expect.stringMatching(/^ui:\/\/mapbox\/preview-style\//),
169-
mimeType: 'text/uri-list',
168+
mimeType: 'text/html;profile=mcp-app',
170169
text: expect.stringContaining(
171170
'https://api.mapbox.com/styles/v1/test-user/cmojrmkc9002t01ry96yi6h48.html?access_token=pk.'
172171
)

test/tools/retrieve-style-tool/RetrieveStyleTool.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ describe('RetrieveStyleTool', () => {
2929
});
3030

3131
it('should have correct input schema', async () => {
32-
const { RetrieveStyleSchema } = await import(
33-
'../../../src/tools/retrieve-style-tool/RetrieveStyleTool.input.schema.js'
34-
);
32+
const { RetrieveStyleSchema } =
33+
await import('../../../src/tools/retrieve-style-tool/RetrieveStyleTool.input.schema.js');
3534
expect(RetrieveStyleSchema).toBeDefined();
3635
});
3736
});

test/tools/update-style-tool/UpdateStyleTool.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ describe('UpdateStyleTool', () => {
2929
});
3030

3131
it('should have correct input schema', async () => {
32-
const { UpdateStyleInputSchema } = await import(
33-
'../../../src/tools/update-style-tool/UpdateStyleTool.input.schema.js'
34-
);
32+
const { UpdateStyleInputSchema } =
33+
await import('../../../src/tools/update-style-tool/UpdateStyleTool.input.schema.js');
3534
expect(UpdateStyleInputSchema).toBeDefined();
3635
});
3736
});

0 commit comments

Comments
 (0)