Skip to content

Fix test failures from testing refactor fallout#391

Merged
Zgjim Haziri (ZgjimHaziri) merged 1 commit into
mainfrom
fix-test-suite-after-testing-refactor
Jul 1, 2026
Merged

Fix test failures from testing refactor fallout#391
Zgjim Haziri (ZgjimHaziri) merged 1 commit into
mainfrom
fix-test-suite-after-testing-refactor

Conversation

@ZgjimHaziri

Copy link
Copy Markdown
Contributor

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 validate test written against the older mock-based style — it referenced an undefined mockWriteFileSync, 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, via jest.spyOn, still writes the real report file under the mocked temp cwd). While verifying, I also hardened the FileService spec: its fixed-name temp directories leaked between runs and caused EEXIST on 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

  • No JIRA ticket — test-suite fix.

Checklist

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios (full suite green over two consecutive runs, 52 suites / 458 tests)
  • I have updated docs if needed (not needed — test-only)

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>
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@ZgjimHaziri Zgjim Haziri (ZgjimHaziri) merged commit 0bf8872 into main Jul 1, 2026
5 checks passed
@ZgjimHaziri Zgjim Haziri (ZgjimHaziri) deleted the fix-test-suite-after-testing-refactor branch July 1, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants