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

+7 -9
View File
@@ -46,15 +46,13 @@ describe("a name written into a header and read back out", () => {
`every\t\n\r"\\${BELL}.txt`,
];
for (const name of names) {
it(`is the name that went in: ${JSON.stringify(name)}`, () => {
const written = quoteGitPatchPath(name);
expect(unquoteGitPatchPath(written)).toBe(name);
// A parser that takes the quotes off itself, as the clients' one does, gets there too.
const unwrapped = written.startsWith('"') ? written.slice(1, -1) : written;
expect(unquoteGitPatchPath(unwrapped)).toBe(name);
});
}
it.each(names)("is the name that went in: %j", (name) => {
const written = quoteGitPatchPath(name);
expect(unquoteGitPatchPath(written)).toBe(name);
// A parser that takes the quotes off itself, as the clients' one does, gets there too.
const unwrapped = written.startsWith('"') ? written.slice(1, -1) : written;
expect(unquoteGitPatchPath(unwrapped)).toBe(name);
});
it("carries the whole name past the first thing a header stops at", () => {
const written = quoteGitPatchPath("tab\tfile.txt");