Skip to content
Back to skills

Tests

ASecurity

How to work in `tests/`. Read before editing here.

  • 16 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 25, 2026
ai-agentsgo

Works with

  • terminal
  • cli

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 25, 2026

npx -y skills add Kevin-Liu-01/Local-Search --skill tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kevin-liu-01-tests/badge)](https://www.skillsdirectory.com/skills/kevin-liu-01-tests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tests-skill
description: How to work in `tests/`. Read before editing here.
---

# Local-Search / tests

## Purpose
<!-- agent-docs:fill:purpose -->
Public CLI regression tests. Exercise real binaries against isolated local state,
fake browser endpoints, and fake registries rather than personal browser data.

## Mental model & key files
<!-- agent-docs:fill:model -->
- `cli.rs` checks help, welcome text, output modes, and structured errors.
- `connection.rs` checks explicit browser selection, background work tabs,
  disconnection, and cleanup boundaries with local fake CDP endpoints.
- `updates.rs` checks update JSON, aliases, package-manager detection, opt-out,
  timeout, and macOS interactive startup via `/usr/bin/script`.

## Patterns to follow / invariants
<!-- agent-docs:fill:patterns -->
- Set `LOCAL_SEARCH_CONFIG_DIR` to a test-owned temporary directory.
- Never connect to a real signed-in browser or fetch a registry in unit/integration tests.
- Keep stdout contracts parseable, and assert stderr and exit status separately.
- Use subprocess-specific environment overrides, not global environment mutations.
- Bound waits and shut down fake listeners and child processes at test completion.
- Serialize update-check subprocess/PTY fixtures because their real two-second
  deadlines must not compete with sibling cold process launches on loaded hosts.

## Common tasks → first action
<!-- agent-docs:fill:tasks -->
- Run `cargo test --test updates` for release-check changes.
- Run `cargo test --test connection` for browser authority and lifecycle changes.
- Finish with `cargo fmt --check`, `cargo test`, and
  `cargo clippy --all-targets --all-features -- -D warnings`.

## Gotchas
<!-- agent-docs:fill:gotchas -->
- The npm wrapper has its own version; fixtures must not equate it with the native crate.
- Interactive update checks require both output streams to be terminals. Pipes
  intentionally do not exercise that path.
- Unix fake executables need execute permission. PTY assertions are macOS-only;
  pure update/cache tests also run on other platforms.

Files in this skill

  • SKILL.md2 KB
  • cli.rs1.6 KB
  • connection.rs13.7 KB
  • updates.rs9.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.