fix: clean plugin test temp directories#25
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prevents repository-root pollution from plugin unit tests by moving their temporary plugin directories to the OS temp directory and ensuring they are always deleted after each test run. It also cleans up already-tracked generated temp folders and ignores future generated artifacts (including TypeScript build info).
Changes:
- Update plugin unit tests to create temp plugin/reload directories under
os.tmpdir()and delete them infinallyblocks viafs.rmSync(..., { recursive: true, force: true }). - Add
.gitignoreentries fortmp-easy-plugin-*,tmp-easy-plugin-reload-*, andtsconfig.tsbuildinfo. - Remove previously committed generated temp plugin directories and
tsconfig.tsbuildinfofrom the repository.
Reviewed changes
Copilot reviewed 61 out of 63 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .gitignore | Ignore generated plugin test temp directories and TypeScript build info. |
| tests/unit/plugins.test.js | Create plugin/reload temp dirs in os.tmpdir() and clean them up after tests. |
| tsconfig.tsbuildinfo | Remove tracked TS build info output file. |
| tmp-easy-plugin-0NRnhP/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-0NRnhP/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-78wEGt/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-78wEGt/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-7QrAzY/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-7QrAzY/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-9MnZaD/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-9MnZaD/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-AE4KNe/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-AE4KNe/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-MdEHLs/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-MdEHLs/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-SXSifI/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-SXSifI/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-VmpBbA/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-VmpBbA/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-WvNtM5/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-WvNtM5/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-cwg5ge/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-cwg5ge/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-elTJXZ/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-elTJXZ/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-gan5xo/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-gan5xo/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-kY0KWa/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-kY0KWa/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-l4uin0/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-l4uin0/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-nddJ7S/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-nddJ7S/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-pzD6ku/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-pzD6ku/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-qJUv3x/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-qJUv3x/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-tNYrKw/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-tNYrKw/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-uQNl1p/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-uQNl1p/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-xwHChm/README.md | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-xwHChm/sample.js | Remove tracked generated plugin test temp content. |
| tmp-easy-plugin-reload-29hxA5/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-5Kolpd/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-7UMMGk/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-7pXFh5/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-CHVNLN/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-H8m4vp/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-JYxfaq/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-NYeFLR/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-USlKOy/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-VFUlHh/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-WRtH5K/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-bLOU2w/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-btQGX2/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-mGwrQy/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-mbLk7M/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-pJ852Y/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-qwW5dA/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-slWK0n/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-tx40dX/reload.js | Remove tracked generated plugin reload test temp content. |
| tmp-easy-plugin-reload-xGT7SO/reload.js | Remove tracked generated plugin reload test temp content. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+216
to
+217
| watchFile.mockRestore(); | ||
| } finally { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
os.tmpdir().fs.rmSync(..., { recursive: true, force: true }).tsconfig.tsbuildinfo.tmp-easy-plugin-*,tmp-easy-plugin-reload-*, andtsconfig.tsbuildinfofiles.This is a clean maintainer version of the useful temp-directory cleanup approach from PR #2, without the unrelated dependency, TypeScript, frontend, or CI changes from that branch.
Closes #1
Testing
npm test -- tests/unit/plugins.test.js --runInBandnpm run verifynpm run typechecknpm test -- --runInBandnpm run validate:productionnpm run lint:easynpm run test:coverageAlso verified that running the plugin tests creates 0 new
tmp-easy-plugin-*directories in the repository root.