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:
Julius MarmingeandClaude Opus 5.5 authored and GitHub committed 2026-10-02 16:07:50 -07:00
1 parent a8927712f8
commit fd7ee2c30a
86 files changed
+6142 -6059

No files matched your search

+27 -27
View File
@@ -1269,8 +1269,9 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
).pipe(Effect.provideService(HostProcessPlatform, "linux")),
);
for (const targetArch of ["x64", "arm64"] as const) {
it.effect(`accepts an embedded archive with the Linux ${targetArch} node-pty prebuild`, () =>
it.effect.each(["x64", "arm64"] as const)(
"accepts an embedded archive with the Linux %s node-pty prebuild",
(targetArch) =>
Effect.scoped(
Effect.gen(function* () {
const fixture = yield* makeWindowsPayloadFixture({
@@ -1290,33 +1291,32 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
assert.equal(result.packagedAppDir, fixture.packagedAppDir);
}),
).pipe(Effect.provideService(HostProcessPlatform, "linux")),
);
);
it.effect(
`rejects a node-pty prebuild for the wrong architecture in a Linux ${targetArch} archive`,
() =>
Effect.scoped(
Effect.gen(function* () {
const fixture = yield* makeWindowsPayloadFixture({
copyUnpackedNatives: true,
wslRuntime: "valid",
targetArch,
ptyPrebuildArch: targetArch === "x64" ? "arm64" : "x64",
});
const error = yield* validateWindowsPackagedPayload({
stageDistDir: fixture.stageDistDir,
appExecutableName: fixture.appExecutableName,
targetArch,
appVersion: WINDOWS_PAYLOAD_FIXTURE_VERSION,
expectWslRuntime: true,
}).pipe(Effect.flip);
it.effect.each(["x64", "arm64"] as const)(
"rejects a node-pty prebuild for the wrong architecture in a Linux %s archive",
(targetArch) =>
Effect.scoped(
Effect.gen(function* () {
const fixture = yield* makeWindowsPayloadFixture({
copyUnpackedNatives: true,
wslRuntime: "valid",
targetArch,
ptyPrebuildArch: targetArch === "x64" ? "arm64" : "x64",
});
const error = yield* validateWindowsPackagedPayload({
stageDistDir: fixture.stageDistDir,
appExecutableName: fixture.appExecutableName,
targetArch,
appVersion: WINDOWS_PAYLOAD_FIXTURE_VERSION,
expectWslRuntime: true,
}).pipe(Effect.flip);
assert.instanceOf(error, WindowsPackagedPayloadValidationError);
assert.equal(error.reason, "wsl-runtime-invalid");
}),
),
);
}
assert.instanceOf(error, WindowsPackagedPayloadValidationError);
assert.equal(error.reason, "wsl-runtime-invalid");
}),
),
);
it.effect("rejects an embedded archive built for a different release version", () =>
Effect.scoped(
+22 -24
View File
@@ -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.
+5 -4
View File
@@ -78,8 +78,9 @@ function createList(bundle: string) {
};
}
for (const bundle of ["react-native.js", "react-native.mjs"]) {
describe(`initial inset end reveal (${bundle})`, () => {
describe.each(["react-native.js", "react-native.mjs"])(
"initial inset end reveal (%s)",
(bundle) => {
it("waits for the native offset instead of the optimistic scroll target", () => {
const list = createList(bundle);
list.start();
@@ -210,5 +211,5 @@ for (const bundle of ["react-native.js", "react-native.mjs"]) {
empty.complete();
expect(empty.ready()).toBe(true);
});
});
}
},
);