fix(tests): isolate fast-jev no-key test's cwd - #83
Merged
Merged
Conversation
Prevents the no-key fallback test from sharing process.cwd() with other fast-jev tests via session.cwd(), the same isolation pattern already used by the with-key test.
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.
Intent
fix(tests): isolate fast-jev no-key test's cwd. Give the no-key fallback test its own temporary working directory with reliable cleanup so it does not share process.cwd() with other tests in the file. Preserve the existing behavior assertions and ensure the fast-jev no-key path makes no network request.
What Changed
tests/fm-jev-hook-guards.test.mjs: fast-jev no-key fallback test now creates its own temp directory viamkdtempand passes it assession.cwd()instead of sharingsafetyRootwith other tests in the file.rm(root, { recursive: true, force: true })after assertions run.Risk Assessment
✅ Low: Single test file change: no-key test now gets its own mkdtemp'd cwd with try/finally cleanup via rm, preserves existing assertions (fallback true, zero requests), imports already present, matches stated intent exactly with no scope creep.
Testing
Ran fm-jev-hook-guards.test.mjs live at target commit: no-key test passes, asserts fallback true and requests 0, uses isolated tmpdir cleaned via finally/rm, confirmed no leftover dirs. 4 other tests in file fail but reproduced identically at base commit before this change, so unrelated pre-existing issues, not caused by this fix.
node --test tests/fm-jev-hook-guards.test.mjs->ok 1 - fast-jev falls back without a key and sends no request;ls -laafter run shows no leftover.fast-jev-no-key-test-*dirsafetyRootused by other tests at lines 129,151,193,219,248,271Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
node --test tests/fm-jev-hook-guards.test.mjs->ok 1 - fast-jev falls back without a key and sends no request;ls -laafter run shows no leftover.fast-jev-no-key-test-*dirsafetyRootused by other tests at lines 129,151,193,219,248,271node --test tests/fm-jev-hook-guards.test.mjs (target commit 52662121)node --test tests/fm-jev-hook-guards.test.mjs (base commit 7e5c4fd0, same file reverted) to isolate pre-existing failures✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.