Skip to content

[jsweep] Clean check_skip_if_helpers.cjs#22535

Merged
pelikhan merged 2 commits intomainfrom
jsweep/clean-check-skip-if-helpers-2811bde5cfe94720
Mar 23, 2026
Merged

[jsweep] Clean check_skip_if_helpers.cjs#22535
pelikhan merged 2 commits intomainfrom
jsweep/clean-check-skip-if-helpers-2811bde5cfe94720

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Added comprehensive test coverage for check_skip_if_helpers.cjs — the oldest uncleaned file without tests.

File: check_skip_if_helpers.cjs

Context type: github-script (uses core and context globals)

File analysis: The file was already clean — @ts-check enabled, JSDoc typed, modern JS syntax. The only missing piece was test coverage (0 tests).

Changes

  • Created check_skip_if_helpers.test.cjs with 10 tests (0 → 10)

Test coverage added

Tests for buildSearchQuery(skipQuery, skipScope):

scope: none

  • Returns raw query unchanged when skipScope === "none"
  • Logs correct "Using raw query" message
  • Does not append repo: to the query
  • Handles complex multi-word queries

scope: default (repo-scoped)

  • Appends repo:owner/repo when skipScope is undefined
  • Appends repo:owner/repo when skipScope is empty string ""
  • Appends repo:owner/repo for any non-"none" value
  • Logs correct "Scoped query" message
  • Reads owner and repo from context.repo (custom values tested)
  • Handles multi-word queries with repo scoping

✅ Validation checks

  • Formatting (npm run format:cjs): ✓ unchanged
  • Linting (npm run lint:cjs): ✓ All matched files use Prettier code style
  • Type checking (npm run typecheck): ✓ No errors
  • Tests (npm run test:js -- --no-file-parallelism): ✓ All 10 tests pass

Warning

⚠️ Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • invalid.example.invalid
  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "invalid.example.invalid"
    - "proxy.golang.org"

See Network Configuration for more information.

Generated by jsweep - JavaScript Unbloater ·

  • expires on Mar 25, 2026, 10:02 PM UTC

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>
@pelikhan pelikhan marked this pull request as ready for review March 23, 2026 22:17
Copilot AI review requested due to automatic review settings March 23, 2026 22:17
Copy link
Copy Markdown
Contributor

Copilot AI 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

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 both skipScope === "none" and default repo-scoped behavior.
  • Validated correct query output formatting (raw vs repo:owner/repo appended).
  • Validated expected core.info(...) logging for both modes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pelikhan pelikhan merged commit ad6e063 into main Mar 23, 2026
68 of 112 checks passed
@pelikhan pelikhan deleted the jsweep/clean-check-skip-if-helpers-2811bde5cfe94720 branch March 23, 2026 22:20
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