refactor: add integrationTest() helper to reduce test boilerplate (#3711)

## Summary
- Adds an `integrationTest()` wrapper in
`packages/fresh/src/test_utils.ts` that calls `Deno.test` with
`sanitizeOps: false` and `sanitizeResources: false`
- Converts ~88 integration tests across 5 files to use the new helper,
removing repetitive sanitizer boilerplate
- Net reduction of ~344 lines (-1678/+1334)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bartek Iwańczuk
2026-03-30 19:14:10 +02:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 196509274f
commit a872a70e5f
7 changed files with 1501 additions and 1894 deletions
File diff suppressed because it is too large Load Diff
+20
View File
@@ -182,6 +182,26 @@ export class MockBuildCache<State> implements BuildCache<State> {
}
}
/**
* Wrapper around `Deno.test` for integration tests that disables sanitizers.
* Accepts either a name string or an options object (without `fn`), plus the
* test function.
*/
export function integrationTest(
nameOrOptions: string | Omit<Deno.TestDefinition, "fn">,
fn: () => void | Promise<void>,
): void {
const options = typeof nameOrOptions === "string"
? { name: nameOrOptions }
: nameOrOptions;
Deno.test({
...options,
fn,
sanitizeOps: false,
sanitizeResources: false,
});
}
export async function writeFiles(dir: string, files: Record<string, string>) {
const entries = Object.entries(files);
await Promise.all(entries.map(async (entry) => {