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

Add package scripts and cli library, enable integration testing#536

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

Open
jaggederest wants to merge9 commits intomain
base:main
Choose a base branch
Loading
fromjaggederest/integration_tests

Conversation

jaggederest
Copy link

@jaggederestjaggederest commentedJun 16, 2025
edited
Loading

A working vscode-test integration test that validates that the module will load and add commands, at least.

NB thepretty_bytes nonsense is a temporary workaround, I won't merge this until I've fixed the actual usage, but I wanted to get a demonstration test going ASAP since right now I can happily make totally breaking changes 🤦

Copy link

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Enables integration testing and adds dynamic CLI/utility loading support.

  • Adds a placeholder extension test to validate the test pipeline.
  • Implements dynamic ESM imports forpretty-bytes instorage.ts andremote.ts.
  • Updatespackage.json and introduces.vscode-test.mjs to configure and run integration tests.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/test/extension.test.tsIntroduces a dummy test suite to verify the test harness
src/storage.tsAdds dynamic import ofpretty-bytes infetchBinary
src/remote.tsApplies dynamic import ofpretty-bytes and makesupdateStatus async
package.jsonAddstest:integration, pretest hooks, and new test CLI deps
.vscode-test.mjsConfigures VSCode Test CLI for integration test discovery
Comments suppressed due to low confidence (3)

src/test/extension.test.ts:3

  • [nitpick] The suite name 'first test' is generic; consider renaming it to reflect its purpose (e.g., 'Extension activation suite').
suite("first test", () => {

src/storage.ts:127

  • The dynamic import logic infetchBinary isn't covered by existing tests; consider adding unit tests to verify thatpretty-bytes is loaded correctly and used as expected.
// Load ESM module if not already loaded

src/remote.ts:846

  • The new asyncupdateStatus function with dynamic import isn't covered by tests; consider adding integration tests to validate its behavior under different network inputs.
const updateStatus = async (network: {

jaggederestand others added5 commitsJune 16, 2025 14:31
- Add test mode detection to bypass Remote SSH extension requirement- Skip remoteAuthority access in test mode to avoid API proposal errors- Update test expectations to match actual extension behavior- Configure vscode-test to enable proposed API for tests- Add proper command registration verification with timing delayThe extension now gracefully handles test environments where the RemoteSSH extension is not available, allowing integration tests to pass.🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
- Add vitest.config.ts with proper include/exclude patterns- Exclude src/test/** directory from unit tests (VS Code integration tests)- Exclude compiled out/** directory from test discovery- Update tsconfig.json to exclude vitest.config.ts from compilation- Add .eslintignore to skip linting vitest config- Update test script to use default Vitest behavior- Fix .vscodeignore formatting (add missing newline)🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
@jaggederestjaggederest marked this pull request as ready for reviewJune 16, 2025 22:05
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.

Leaving off an approve until we sortprettyBytes but this is great!

);
throw new Error("Remote SSH extension not found");
}
// In test mode, use regular vscode API
Copy link
Member

Choose a reason for hiding this comment

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

Nice! I wonder if we can avoid the special testing behavior. Maybe we should always try to activate, but if we are unable to get this special API we skip the remote registration (and possibly log a warning)? Similar to what you already have except we always do it, not just in testing.

That would make it nicer for use cases where you have not installed the remote extension yet, for whatever reason, while reducing drift between production and testing.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah I suspect this is the kind of behavior we want, so 👍 to logging a warning and handling it gracefully

code-asher reacted with thumbs up emoji
import prettyBytes from "pretty-bytes";
// Dynamic import for ESM module
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let prettyBytes: any;
Copy link
Member

Choose a reason for hiding this comment

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

I know you said this was temporary, just leaving a note here to acknowledge we need to update this and other references before merge. 😄

jaggederest reacted with heart emoji
import * as assert from "assert";
import * as vscode from "vscode";

suite("Extension Test Suite", () => {
Copy link
Member

Choose a reason for hiding this comment

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

Exciting to have this working!!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@aslilacaslilacaslilac left review comments

@code-ashercode-ashercode-asher left review comments

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

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

Successfully merging this pull request may close these issues.

3 participants
@jaggederest@aslilac@code-asher

[8]ページ先頭

©2009-2025 Movatter.jp