@@ -141,25 +141,29 @@ describe("GET /api/wallet/keys", () => {
141141 }
142142 } ) ;
143143
144- it ( "rejects loopback requests without a token during active onboarding" , async ( ) => {
145- await fs . writeFile (
146- path . join ( tempDir , "eliza.json" ) ,
147- JSON . stringify ( {
148- meta : { onboardingComplete : false } ,
149- logging : { level : "error" } ,
150- } ) ,
151- ) ;
144+ it . each ( [ "production" , "development" ] ) (
145+ "rejects loopback requests without a token during active onboarding in %s" ,
146+ async ( nodeEnv ) => {
147+ process . env . NODE_ENV = nodeEnv ;
148+ await fs . writeFile (
149+ path . join ( tempDir , "eliza.json" ) ,
150+ JSON . stringify ( {
151+ meta : { onboardingComplete : false } ,
152+ logging : { level : "error" } ,
153+ } ) ,
154+ ) ;
152155
153- const server = await startApiServer ( { port : 0 , runtime : RUNTIME_STUB } ) ;
154- try {
155- // Sensitive routes require an API token even for loopback requests.
156- // Without ELIZA_API_TOKEN / MILADY_API_TOKEN the server returns 403.
157- const { status } = await req ( server . port , "GET" , "/api/wallet/keys" ) ;
158- expect ( status ) . toBe ( 403 ) ;
159- } finally {
160- await server . close ( ) ;
161- }
162- } ) ;
156+ const server = await startApiServer ( { port : 0 , runtime : RUNTIME_STUB } ) ;
157+ try {
158+ // Sensitive routes require an API token even for loopback requests.
159+ // Without ELIZA_API_TOKEN / MILADY_API_TOKEN the server returns 403.
160+ const { status } = await req ( server . port , "GET" , "/api/wallet/keys" ) ;
161+ expect ( status ) . toBe ( 403 ) ;
162+ } finally {
163+ await server . close ( ) ;
164+ }
165+ } ,
166+ ) ;
163167
164168 it ( "returns 200 with a valid auth token during onboarding" , async ( ) => {
165169 await fs . writeFile (
0 commit comments