[jsweep] Clean check_skip_if_helpers.cjs#22535
Merged
Conversation
Add 10 comprehensive tests for buildSearchQuery covering: - scope 'none': returns raw query unchanged, correct log message, no repo appended - scope default: appends repo:owner/repo, correct log message, respects context.repo - Edge cases: empty string scope, non-'none' string scope, complex multi-word queries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds missing unit test coverage for check_skip_if_helpers.cjs (specifically buildSearchQuery) to bring the last previously-untested “uncleaned” JS file under test coverage.
Changes:
- Added a new Vitest test suite covering
buildSearchQuery(skipQuery, skipScope)for bothskipScope === "none"and default repo-scoped behavior. - Validated correct query output formatting (raw vs
repo:owner/repoappended). - Validated expected
core.info(...)logging for both modes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Mar 23, 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.
Summary
Added comprehensive test coverage for
check_skip_if_helpers.cjs— the oldest uncleaned file without tests.File:
check_skip_if_helpers.cjsContext type: github-script (uses
coreandcontextglobals)File analysis: The file was already clean —
@ts-checkenabled, JSDoc typed, modern JS syntax. The only missing piece was test coverage (0 tests).Changes
check_skip_if_helpers.test.cjswith 10 tests (0 → 10)Test coverage added
Tests for
buildSearchQuery(skipQuery, skipScope):scope: none
skipScope === "none"repo:to the queryscope: default (repo-scoped)
repo:owner/repowhenskipScopeisundefinedrepo:owner/repowhenskipScopeis empty string""repo:owner/repofor any non-"none"valueownerandrepofromcontext.repo(custom values tested)✅ Validation checks
npm run format:cjs): ✓ unchangednpm run lint:cjs): ✓ All matched files use Prettier code stylenpm run typecheck): ✓ No errorsnpm run test:js -- --no-file-parallelism): ✓ All 10 tests passWarning
The following domains were blocked by the firewall during workflow execution:
invalid.example.invalidproxy.golang.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.