Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor storage.ts into testable modules and add unit tests#589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
EhabY merged 12 commits intocoder:mainfromEhabY:untangle-storage-ts
Sep 25, 2025

Conversation

EhabY
Copy link
Collaborator

@EhabYEhabY commentedSep 22, 2025
edited
Loading

Closes#588

This PR refactorsstorage.ts into small, isolated modules that are straightforward to unit test (with mocks). It also upgradesvitest to a version that plays nicely with VS Code extensions, so we can view coverage, run and debug tests directly in VS Code.

VS Code Test Explorer:

Screencast.from.2025-09-22.16-54-03.webm

Why mockvscode?

With the current VS Code Extension API, we essentially have two testing layers:

  • Unit tests (mockedvscode) : Validate our module's behavior independently of the VS Code API and external calls (e.g., Axios). These are fast, reliable, and cover most logic.
  • Integration/E2E tests (real VS Code): Exercise "real" user flows by launching VS Code and, eventually, a server. These are valuable but more limited, since UI interaction is hard to automate and not all code paths are easily reachable.

By mockingvscode for unit tests, we keep feedback tight and deterministic, while reserving integration tests for end-to-end scenarios that require the actual runtime.

Copy link
Member

@code-ashercode-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Excellent! The only thing I think maybe needs a double-check before merging is theuseCustom with the proposed API. If you want to merge and address the rest later, I think that is chill, or you could do it here, up to you!

@EhabYEhabY merged commit52df12c intocoder:mainSep 25, 2025
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@code-ashercode-ashercode-asher approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Refactor storage.ts into testable modules and add unit tests
2 participants
@EhabY@code-asher

[8]ページ先頭

©2009-2025 Movatter.jp