Skip to content

Commit 8fd23df

Browse files
committed
test: tweak renderBuiltUrl-string test
1 parent 99cb014 commit 8fd23df

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/plugin-rsc/e2e/starter.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,23 @@ test.describe(() => {
311311
rsc: './src/framework/entry.rsc.tsx',
312312
}
313313
}),
314+
{
315+
// simulate custom asset server
316+
name: 'custom-server',
317+
configurePreviewServer(server) {
318+
server.middlewares.use((req, res, next) => {
319+
const url = new URL(req.url ?? '', "http://localhost");
320+
if (url.pathname.startsWith('/custom-server/')) {
321+
req.url = url.pathname.replace('/custom-server/', '/');
322+
}
323+
next();
324+
});
325+
}
326+
}
314327
],
315328
experimental: {
316329
renderBuiltUrl(filename) {
317-
return '/' + filename;
330+
return '/custom-server/' + filename;
318331
}
319332
}
320333
})

0 commit comments

Comments
 (0)