File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 1
1
import fetch from 'node-fetch' ;
2
2
import { startTServer } from './utils/tserver' ;
3
3
4
- it ( 'should use the response returned from context' , async ( ) => {
5
- const server = startTServer ( {
6
- context : ( ) => {
7
- return [ null , { status : 418 } ] ;
8
- } ,
9
- } ) ;
4
+ it . each ( [ 'schema' , 'context' , 'onSubscribe' , 'onOperation' ] ) (
5
+ 'should use the response returned from %s' ,
6
+ async ( option ) => {
7
+ const server = startTServer ( {
8
+ [ option ] : ( ) => {
9
+ return [ null , { status : 418 } ] ;
10
+ } ,
11
+ } ) ;
10
12
11
- const url = new URL ( server . url ) ;
12
- url . searchParams . set ( 'query' , '{ __typename }' ) ;
13
- const res = await fetch ( url . toString ( ) ) ;
14
- expect ( res . status ) . toBe ( 418 ) ;
15
- } ) ;
13
+ const url = new URL ( server . url ) ;
14
+ url . searchParams . set ( 'query' , '{ __typename }' ) ;
15
+ const res = await fetch ( url . toString ( ) ) ;
16
+ expect ( res . status ) . toBe ( 418 ) ;
17
+ } ,
18
+ ) ;
You can’t perform that action at this time.
0 commit comments