Skip to content

Commit c6dbe6a

Browse files
committed
chore: add tests for new conformance test scenarios
1 parent 81edcd4 commit c6dbe6a

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { describe, test } from 'vitest';
2+
import {
3+
runClientAgainstScenario,
4+
InlineClientRunner
5+
} from './auth/test_helpers/testClient';
6+
7+
// A bad client that does not send _meta
8+
async function badClient(serverUrl: string) {
9+
const response = await fetch(serverUrl, {
10+
method: 'POST',
11+
headers: {
12+
'Content-Type': 'application/json'
13+
},
14+
body: JSON.stringify({
15+
jsonrpc: '2.0',
16+
id: 1,
17+
method: 'tools/list',
18+
params: {} // Missing _meta
19+
})
20+
});
21+
return response.json();
22+
}
23+
24+
describe('Stateless Client Scenario Negative Tests', () => {
25+
test('client fails when omitting _meta', async () => {
26+
const runner = new InlineClientRunner(badClient);
27+
28+
// runClientAgainstScenario searches for the scenario by name in the registry
29+
await runClientAgainstScenario(runner, 'stateless-client', {
30+
expectedFailureSlugs: ['client-populates-meta']
31+
});
32+
});
33+
});

0 commit comments

Comments
 (0)