File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments