chore(lint): forbid declaring tests inside for loops (#14921)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
a8927712f8
commit
fd7ee2c30a
86 files changed
+6142
-6059
No files matched your search
+22
-24
@@ -414,8 +414,9 @@ it.layer(NodeServices.layer)("dev-runner", (it) => {
|
||||
// Browser dev is single-origin: Vite proxies the backend, and the client
|
||||
// resolves it from window.location.origin. Baking a localhost URL here is
|
||||
// what breaks sharing a dev server to another device.
|
||||
for (const mode of ["dev", "dev:web"] as const) {
|
||||
it.effect(`leaves the client backend URLs unset in ${mode} mode`, () =>
|
||||
it.effect.each(["dev", "dev:web"] as const)(
|
||||
"leaves the client backend URLs unset in %s mode",
|
||||
(mode) =>
|
||||
Effect.gen(function* () {
|
||||
const env = yield* createDevRunnerEnv({
|
||||
mode,
|
||||
@@ -442,8 +443,7 @@ it.layer(NodeServices.layer)("dev-runner", (it) => {
|
||||
// the intent has to be stated positively.
|
||||
assert.equal(env.T3CODE_SINGLE_ORIGIN_DEV, "1");
|
||||
}),
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
// Desktop pins the renderer at loopback deliberately; an ambient marker
|
||||
// must not make Vite discard those URLs.
|
||||
@@ -492,27 +492,25 @@ it.layer(NodeServices.layer)("dev-runner", (it) => {
|
||||
// HOST is Vite's bind address and gates the HMR pin in vite.config.ts. An
|
||||
// inherited one would survive into browser dev and point HMR at the wrong
|
||||
// interface — invisible over a shared origin, since the page still loads.
|
||||
for (const mode of ["dev", "dev:web"] as const) {
|
||||
it.effect(`drops an inherited HOST in ${mode} mode`, () =>
|
||||
Effect.gen(function* () {
|
||||
const env = yield* createDevRunnerEnv({
|
||||
mode,
|
||||
baseEnv: { HOST: "0.0.0.0" },
|
||||
serverOffset: 0,
|
||||
webOffset: 0,
|
||||
t3Home: undefined,
|
||||
browser: undefined,
|
||||
autoBootstrapProjectFromCwd: undefined,
|
||||
logWebSocketEvents: undefined,
|
||||
host: undefined,
|
||||
port: undefined,
|
||||
devUrl: undefined,
|
||||
});
|
||||
it.effect.each(["dev", "dev:web"] as const)("drops an inherited HOST in %s mode", (mode) =>
|
||||
Effect.gen(function* () {
|
||||
const env = yield* createDevRunnerEnv({
|
||||
mode,
|
||||
baseEnv: { HOST: "0.0.0.0" },
|
||||
serverOffset: 0,
|
||||
webOffset: 0,
|
||||
t3Home: undefined,
|
||||
browser: undefined,
|
||||
autoBootstrapProjectFromCwd: undefined,
|
||||
logWebSocketEvents: undefined,
|
||||
host: undefined,
|
||||
port: undefined,
|
||||
devUrl: undefined,
|
||||
});
|
||||
|
||||
assert.equal(env.HOST, undefined);
|
||||
}),
|
||||
);
|
||||
}
|
||||
assert.equal(env.HOST, undefined);
|
||||
}),
|
||||
);
|
||||
|
||||
// --host configures the *backend* (T3CODE_HOST). It must not become Vite's
|
||||
// bind address by way of an inherited HOST that happens to agree with it.
|
||||
|
||||
Reference in new issue
Block a user