File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
dev-packages/node-integration-tests/utils
packages/remix/test/integration Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,12 @@ async function makeRequest(
118118 await axios . post ( url , axiosConfig ) ;
119119 }
120120 } catch ( e ) {
121- // We sometimes expect the request to fail, but not the test.
122- // So, we do nothing.
121+ // We sometimes expect the request to fail, but not the test, so we are just logging the error.
122+ // Beware though! There are also framework specific errors, e.g. fastify can give a 415 with
123+ // FST_ERR_CTP_INVALID_MEDIA_TYPE if handling of application/x-www-form-urlencoded is not configure
124+ // properly when building a test application / server. Errors of these kind can lead to requests
125+ // not actually hitting the handler, and so no tracing will be happenning. This in its turn will
126+ // most like make the test time out.
123127 logger . warn ( e ) ;
124128 }
125129}
Original file line number Diff line number Diff line change 77 "start" : " remix-serve build"
88 },
99 "dependencies" : {
10+ "@fastify/formbody" : " ^7.4.0" ,
1011 "@mcansh/remix-fastify" : " ^3.2.2" ,
1112 "@remix-run/express" : " 1.17.0" ,
1213 "@remix-run/node" : " 1.17.0" ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { createRequestHandler as createExpressRequestHandler } from '@remix-run/
55import { wrapExpressCreateRequestHandler , wrapFastifyCreateRequestHandler } from '@sentry/remix' ;
66import express from 'express' ;
77import fastify from 'fastify' ;
8+ import formBody from '@fastify/formbody'
89
910import { TestEnv } from '../../../../../../../dev-packages/node-integration-tests/utils' ;
1011
@@ -32,6 +33,7 @@ const runExpressApp = (adapter: Adapter.Builtin | Adapter.Express): Promise<http
3233
3334const runFastifyApp = ( ) : Promise < http . Server > => new Promise ( res => {
3435 const app = fastify ( ) ;
36+ app . register ( formBody ) ;
3537 // @ts -ignore
3638 app . all ( '*' , adapters [ Adapter . Fastify ] ( { build : require ( '../../../build' ) } ) ) ;
3739 app . listen ( { port : 0 } , ( _err , _addr ) => {
You can’t perform that action at this time.
0 commit comments