File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -166,21 +166,18 @@ describe('ParseGraphQLServer', () => {
166166 expect ( ( ) => parseGraphQLServer . applyGraphQL ( new express ( ) ) ) . not . toThrow ( ) ;
167167 } ) ;
168168
169- it ( 'should apply middlewares at config.graphQLPath' , async ( ) => {
169+ it ( 'should apply middlewares at config.graphQLPath' , ( ) => {
170170 let useCount = 0 ;
171- const gqlServer = new ParseGraphQLServer ( parseServer , {
172- graphQLPath : 'somepath' ,
173- } ) ;
174- gqlServer . applyGraphQL ( {
175- use : server => {
176- useCount ++ ;
177- if ( typeof server === 'string' ) {
178- expect ( server ) . toEqual ( 'somepath' ) ;
179- } else {
180- expect ( server . stack [ 1 ] . regexp . toString ( ) ) . toEqual ( '/^somepath\\/?(?=\\/|$)/i' ) ;
181- }
182- } ,
183- } ) ;
171+ expect ( ( ) =>
172+ new ParseGraphQLServer ( parseServer , {
173+ graphQLPath : 'somepath' ,
174+ } ) . applyGraphQL ( {
175+ use : path => {
176+ useCount ++ ;
177+ expect ( path ) . toEqual ( 'somepath' ) ;
178+ } ,
179+ } )
180+ ) . not . toThrow ( ) ;
184181 expect ( useCount ) . toBeGreaterThan ( 0 ) ;
185182 } ) ;
186183 } ) ;
You can’t perform that action at this time.
0 commit comments