Skip to content

refactor: use more production code, fewer mocks in github tests#1943

Open
ckerr wants to merge 8 commits intomainfrom
refactor/fewer-mocks-in-github-tests
Open

refactor: use more production code, fewer mocks in github tests#1943
ckerr wants to merge 8 commits intomainfrom
refactor/fewer-mocks-in-github-tests

Conversation

@ckerr
Copy link
Copy Markdown
Member

@ckerr ckerr commented May 9, 2026

Fifth in a series to move GitHub token + gist management into the main process.

This is a test cleanup PR:

  • Adds support for app.setPath() in the Electron mock
  • Throws an error if the Electron mock's app.getPath() is called with an unexpected key.
  • Makes STATIC_DIR in main/constants work in both production and test environments
  • In github tests, remove the mocks for
    • node:fs
    • fs-extra
    • getTemplate()
  • in github tests, try to not rely on implementation details, eg not mocking/spying low-level filesystem calls. The tests shouldn't care which of fs.existsSync() or fsPromises.exists() is called by production code.

@ckerr ckerr requested a review from dsanders11 May 9, 2026 14:34
@ckerr ckerr requested review from a team and codebytere as code owners May 9, 2026 14:34
@coveralls
Copy link
Copy Markdown

coveralls commented May 9, 2026

Coverage Status

coverage: 88.545% (+0.08%) from 88.468% — refactor/fewer-mocks-in-github-tests into main

@ckerr ckerr removed the request for review from dsanders11 May 9, 2026 14:51
@ckerr ckerr changed the title refactor: use more production code, fewer mocks in github tests [DRAFT] refactor: use more production code, fewer mocks in github tests May 9, 2026
@ckerr ckerr force-pushed the refactor/fewer-mocks-in-github-tests branch from 3ef7374 to 1cca7f5 Compare May 9, 2026 17:12
@ckerr ckerr changed the title [DRAFT] refactor: use more production code, fewer mocks in github tests refactor: use more production code, fewer mocks in github tests May 9, 2026
@ckerr ckerr requested a review from dsanders11 May 9, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants