next.js
9cf9a632 - test: skip .next and other build artifacts in writeFiles filter (#92578)

Commit
14 days ago
test: skip .next and other build artifacts in writeFiles filter (#92578) ### What? Skip `.next`, `.next-profiles`, and `.DS_Store` directories in the `writeFiles` filter when copying test fixture directories. ### Why? `writeInitialFiles` was taking ~500ms because the `fs.cp` filter only skipped `package.json`. When a test uses `files: __dirname`, local build artifacts like `.next` (117MB / 411 files) and `.next-profiles` (147MB) were being copied into the test directory unnecessarily if a dev/build run had previously happened on the test app. This really only applies to working on the repository locally, but it's a nice win for that case. ### How? Expanded the `fs.cp` filter to also skip `.next`, `.next-profiles`, and `.DS_Store`. These are local artifacts never tracked in git. `node_modules` is intentionally not skipped since some tests include tracked `node_modules` as fixtures. <!-- NEXT_JS_LLM_PR -->
Author
Parents
Loading