Background
In #1312, the new `endpoint error paths` describe block in `clients/web/src/test/core/remote-transport.test.ts` (code) spins up a fresh Hono server inside each `it` (10 tests). Each `startRemoteServer(0)` binds + closes a fresh socket, even though none of the tests mutate server state — they all just fire a request and assert response shape.
Proposed change
Fold the common setup into a `beforeEach` at the describe scope:
```ts
describe("endpoint error paths", () => {
let baseUrl: string;
let authToken: string;
beforeEach(async () => {
const started = await startRemoteServer(0);
remoteServer = started.server;
baseUrl = started.baseUrl;
authToken = started.authToken;
});
// each it() just fires a request against baseUrl/authToken
});
```
The same pattern likely applies to a few other describes in `remote-transport.test.ts` (the `storage` block, the `authentication` block) that also call `startRemoteServer(0)` inside every `it`. Easy follow-up scan.
Why
- ~150ms shaved off the integration suite.
- Tests describe the intent ("verify response-shape validation") rather than re-establishing the harness.
- The afterEach already exists at the outer describe scope, so cleanup is unchanged.
Acceptance criteria
Out of scope
- Reorganizing `remote-transport.test.ts` more broadly. This is a targeted cleanup.
Origin
PR #1312 review comment (observation #2).
Background
In #1312, the new `endpoint error paths` describe block in `clients/web/src/test/core/remote-transport.test.ts` (code) spins up a fresh Hono server inside each `it` (10 tests). Each `startRemoteServer(0)` binds + closes a fresh socket, even though none of the tests mutate server state — they all just fire a request and assert response shape.
Proposed change
Fold the common setup into a `beforeEach` at the describe scope:
```ts
describe("endpoint error paths", () => {
let baseUrl: string;
let authToken: string;
beforeEach(async () => {
const started = await startRemoteServer(0);
remoteServer = started.server;
baseUrl = started.baseUrl;
authToken = started.authToken;
});
// each it() just fires a request against baseUrl/authToken
});
```
The same pattern likely applies to a few other describes in `remote-transport.test.ts` (the `storage` block, the `authentication` block) that also call `startRemoteServer(0)` inside every `it`. Easy follow-up scan.
Why
Acceptance criteria
Out of scope
Origin
PR #1312 review comment (observation #2).