Fix test failures from testing refactor fallout#391
Merged
Zgjim Haziri (ZgjimHaziri) merged 1 commit intoJul 1, 2026
Conversation
The recent testing refactors moved the suite toward real files in temp directories and asserting on real output instead of filesystem mocks. A PR merged afterwards added a config-validate test written against the old mock-based approach, referencing an undefined mockWriteFileSync that broke compilation of the whole spec and turned main red. Wire that test up via jest.spyOn(fs, "writeFileSync"), and harden the FileService spec whose fixed-name temp dirs leaked between runs (EEXIST on re-runs) so the suite is idempotent. Includes-AI-Code: true Co-authored-by: Cursor <cursoragent@cursor.com>
|
Buqeta (Buqeta)
approved these changes
Jul 1, 2026
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.



Description
The recent testing refactors moved the suite toward using real files in temp directories and asserting on real process output, rather than filesystem mocks. A PR that merged afterwards added a
config validatetest written against the older mock-based style — it referenced an undefinedmockWriteFileSync, which broke compilation of the whole spec and turned the test suite red.This wires that test up correctly by spying on
fs.writeFileSync(which, viajest.spyOn, still writes the real report file under the mocked tempcwd). While verifying, I also hardened theFileServicespec: its fixed-name temp directories leaked between runs and causedEEXISTon repeated local runs, so setup/teardown now clean up reliably and the suite is idempotent.This is a test-only change — no production code is touched.
Relevant links
Checklist