Skip to content

Commit e2324af

Browse files
committed
Cleanup console logs during e2e tests
1 parent 3d675a9 commit e2324af

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

integration/helpers/create-fixture.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,13 @@ export async function createAppFixture(fixture: Fixture, mode?: ServerMode) {
303303
if (file.endsWith(".html") && !fse.existsSync(path.join(dir, file))) {
304304
file = "__spa-fallback.html";
305305
}
306-
res.sendFile(path.join(dir, file), next);
306+
let filePath = path.join(dir, file);
307+
if (fse.existsSync(filePath)) {
308+
res.sendFile(filePath, next);
309+
} else {
310+
// Avoid a built-in console error from `sendFile` on 404's
311+
res.status(404).send("Not found");
312+
}
307313
});
308314
let server = app.listen(port);
309315
accept({ stop: server.close.bind(server), port });

0 commit comments

Comments
 (0)