Write or review tests for the Static Web Server (SWS) project — unit tests, integration tests, test fixtures, and mocking strategies

Apache-2.0Auto-check passedTesting & QA

Install Testing

skills CLI
$ npx skills add static-web-server/static-web-server --skill testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install static-web-server/static-web-server testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/static-web-server/static-web-server.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/testing .claude/skills/testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing
GitHub stars
2.4k
Token cost
~1.5k tokens
SKILL.md length
436 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write or review tests for the Static Web Server (SWS) project — unit tests, integration tests, test fixtures, and mocking strategies

  • Tasks that involve Unit testing
  • SKILL.md covers Testing Philosophy, Rust Testing, Test Fixture Organization and What to Test, plus 2 more sections
  • Calls cargo
  • Tasks that involve Integration testing

What it does

Testing is an agent skill from static-web-server/static-web-server. Write or review tests for the Static Web Server (SWS) project — unit tests, integration tests, test fixtures, and mocking strategies

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Unit testing, Integration testing and Test data and fixtures. It works with Rust and Linux. The repository describes itself as: A cross-platform, high-performance and asynchronous web server for static files-serving. ⚡. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Unit testing
  • Tasks that involve Integration testing
  • Tasks that involve Test data and fixtures

Example prompts

  • “/testing”

What it can do on your machine

Read from SKILL.md and the folder at commit 32ec4aa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing loads about 1.5k tokens when it runs. Until then it costs about 35 tokens; SKILL.md has 436 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~35
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from static-web-server/static-web-server at commit 32ec4aa, republished under its Apache-2.0 licence (© static-web-server). 436 words, ~1,482 tokens.

Download SKILL.mdSave it as .claude/skills/testing/SKILL.md (or your agent's skills folder).
name
testing
description
Write or review tests for the Static Web Server (SWS) project — unit tests, integration tests, test fixtures, and mocking strategies

Testing Standards

Load this skill when writing, reviewing, or organizing tests — unit, integration, or fixture-based tests.

When to load: adding or editing any #[test] / #[tokio::test], creating a new file under tests/, adding fixtures under tests/fixtures/, or reviewing a PR that changes test coverage.

Testing Philosophy

  • Test behavior, not implementation: Assert on HTTP status codes, response headers, and body content — not internal state. If refactoring without changing behavior breaks a test, the test is wrong
  • One scenario per test: Each test verifies one request scenario. Multiple asserts are fine if they check the same logical outcome
  • Tests are documentation: A test name describes the expected behavior. compression_static_file_exists is better than test_compression_1
  • Fast feedback: Unit tests < 1ms. Integration tests < 100ms

Rust Testing

Unit Tests
  • Location: #[cfg(test)] mod tests { ... } at the bottom of each source file. SWS follows this convention throughout src/
  • Naming: fn feature_scenario_description()
  • Structure: Arrange (setup response/fixture) → Act (call function) → Assert (check headers, status, body)
  • Cover edge cases: Empty input, maximum input, invalid input, boundary values, unsupported methods
  • Use assert_eq! and assert!: Prefer specific assertions over raw assert!
Integration Tests
  • Location: tests/ directory at the crate root
  • Scope: Each file tests one user-visible feature (e.g., tests/compression.rs, tests/cors.rs, tests/dir_listing.rs)
  • Test against real file fixtures: Use tests/fixtures/public/ for test files. Add new fixtures when testing new scenarios
  • Use the fixture infrastructure: Import from static_web_server::testing::fixtures:
    • fixture_settings("toml/handler_fixtures.toml") — load TOML config
    • fixture_req_handler_opts(general, advanced) — build handler options
    • fixture_req_handler(opts) — create a request handler
  • Test with different HTTP methods: Loop over GET, HEAD, OPTIONS and assert correct behavior per method
Show full SKILL.md (185 more words)Show less
Handler Tests

SWS's most common test pattern: create a handler, send a synthetic request, assert on the response:

rust
use std::net::SocketAddr;
use hyper::{Method, Request, header::ACCEPT_ENCODING};
use static_web_server::testing::fixtures::*;
use static_web_server::settings::cli::General;

#[tokio::test]
async fn compression_static_file_exists() {
    let opts = fixture_settings("toml/handler_fixtures.toml");
    let general = General {
        compression_static: true,
        ..opts.general
    };
    let req_handler_opts = fixture_req_handler_opts(general, opts.advanced);
    let req_handler = fixture_req_handler(req_handler_opts);
    let remote_addr: Option<SocketAddr> = Some(REMOTE_ADDR.parse().unwrap());

    let mut req = Request::new(());
    *req.method_mut() = Method::GET;
    *req.uri_mut() = "http://localhost/index.htm".parse().unwrap();
    req.headers_mut().insert(ACCEPT_ENCODING, "gzip, deflate, br".parse().unwrap());

    match req_handler.handle(&mut req, remote_addr).await {
        Ok(res) => {
            assert_eq!(res.status(), 200);
            assert_eq!(res.headers()["content-encoding"], "br");
            assert_eq!(res.headers()["vary"], "accept-encoding");
        }
        Err(err) => panic!("unexpected error: {err}"),
    }
}

REMOTE_ADDR ("127.0.0.1:1234") is exported from static_web_server::testing::fixtures.

Static File Tests

Tests in tests/static_files.rs call static_files::handle() directly with a HandleOpts struct. This tests the file-serving logic in isolation (without the full handler pipeline):

rust
let result = static_files::handle(&HandleOpts {
    method: &Method::GET,
    headers: &HeaderMap::new(),
    base_path: &root_dir(),
    uri_path: "index.htm",
    index_files: &["index.htm"],
    // ... other opts
}).await;
Cleaning Up

Integration tests using pre-existing fixtures under tests/fixtures/ are read-only and need no cleanup. If a test creates temporary files (e.g., a temp upload directory), clean them up in a Drop handler or #[tokio::test] teardown step.

Test Fixture Organization

tests/
  fixtures/
    public/           # Default test file tree
      index.html
      404.html
      assets/
        main.css
        main.css.zst  # Pre-compressed variant for static compression tests
    compression/       # Compression-specific test fixtures
    markdown/          # Markdown content-negotiation test fixtures
    toml/              # TOML config files for handler tests
    tls/               # TLS certificate/key test fixtures

What to Test

  • Always test: Public API surface, error cases, edge cases, HTTP status codes, response headers, supported/unsupported methods
  • Sometimes test: Private functions with branching logic (3+ code paths) or performance-critical code (include benchmarks for the latter)
  • Don't test: Trivial getters/setters, framework glue code, exact log message strings

Run Commands

bash
# Run all tests with all features
RUSTFLAGS="--cfg tokio_unstable" cargo test --tests --features="all"

# Run a specific test
cargo test --test compression -- compression_static_file_exists

# Run with trace logging visible
RUST_LOG=trace cargo test --test static_files -- --nocapture

Checklist

  • Do tests cover the happy path and at least one error path?
  • Do integration tests clean up after themselves?
  • Are test names descriptive?
  • Are mocks used only for external dependencies (network), while filesystem access uses real test fixtures?
  • Are test fixtures minimal (synthetic, small files)?

© static-web-server, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/testing of static-web-server/static-web-server.

Open the folder on GitHubat commit 32ec4aa

Compare with similar skills

Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing this skillstatic-web-server/static-web-server2.4k—~1.5kAutomated safety check: PassApache-2.0
RTK Filter TDD in Rustrtk-ai/rtk83k—~1.9kAutomated safety check: NotesApache-2.0
Aspire Integration TestingDevBetterCom/DevBetterWeb1572 repos~2.3kAutomated safety check: PassNone
Robotics Testingarpitg1304/robotics-agent-skills368—~4.7kAutomated safety check: PassApache-2.0
cargo-pgrx Commands and Testsyugabyte/yugabyte-db11k—~1.9kAutomated safety check: PassCustom licence
Rust Testingaxone-protocol/contracts123—~501Automated safety check: PassBSD-3-Clause

Similar skills

  • Enforces red-green-refactor for new RTK output filters in Rust, using real captured fixtures, snapshot tests with insta and token-savings assertions.

    83k GitHub stars~1.9k tokensUpdated today
    Testing & QAAuto-check: notes
  • Aspire Integration Testing

    DevBetterCom/DevBetterWeb

    Write integration tests using .NET Aspire's testing facilities with xUnit.

    157 GitHub starsUsed in 2 repos~2.3k tokens
    Testing & QAAuto-check passed
  • Robotics Testing

    arpitg1304/robotics-agent-skills

    Testing strategies, patterns, and tools for robotics software.

    368 GitHub stars~4.7k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • cargo-pgrx Commands and Tests

    yugabyte/yugabyte-db

    Helps choose and run cargo-pgrx commands and decide whether a Rust test is a plain test or a pg_test, so code never crosses the Postgres boundary the wrong way.

    11k GitHub stars~1.9k tokensUpdated today
    Testing & QAAuto-check passed
  • Rust Testing

    axone-protocol/contracts

    Patterns for Rust testing in Axone CosmWasm contracts. An agent skill from axone-protocol/contracts.

    123 GitHub stars~501 tokensUpdated 11 days ago
    Testing & QAAuto-check passed
  • Rust Testing

    kurealnum/dotfiles

    Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage.

    290 GitHub starsUsed in 6 repos~2.9k tokens
    Testing & QAAuto-check passed

More from static-web-server/static-web-server

All 9 skills in this repo
  • Design

    static-web-server/static-web-server

    Design or review software architecture, API contracts, data models, and module boundaries for the Static Web Server (SWS) project

    2.4k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Issue Tracking

    static-web-server/static-web-server

    Triage, debug, fix, and document issues for the Static Web Server (SWS) project — bug reports, root cause analysis, fix implementation, and regression prevention

    2.4k GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Performance

    static-web-server/static-web-server

    Optimize or review performance for the Static Web Server (SWS) project — profiling, bottlenecks, resource usage, compression, and caching

    2.4k GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed
  • Prose

    static-web-server/static-web-server

    Author or edit any prose for the Static Web Server (SWS) project — documentation, design docs, READMEs, PR descriptions, issue bodies, commit message bodies, or other human-readable text — following…

    2.4k GitHub stars~971 tokensUpdated yesterday
    Auto-check passed
  • Rust Backend

    static-web-server/static-web-server

    Write or review Rust backend code for the Static Web Server (SWS) project — crates, modules, functions, types, error handling, and async code

    2.4k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Static File Serving

    static-web-server/static-web-server

    Serve static files and web assets with optimal headers, MIME types, compression, and caching for the Static Web Server (SWS) project

    2.4k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Testing

What does Testing do?

Write or review tests for the Static Web Server (SWS) project — unit tests, integration tests, test fixtures, and mocking strategies. Testing is an agent skill from static-web-server/static-web-server.

When should I use Testing?

Testing fits situations like: tasks that involve Unit testing; tasks that involve Integration testing; tasks that involve Test data and fixtures.

How do I install Testing in Claude Code?

Run `npx skills add static-web-server/static-web-server --skill testing -a claude-code`. Or copy the skill folder (.agents/skills/testing in static-web-server/static-web-server) into .claude/skills/testing in your project. Claude Code loads it when a task matches its description.

How do I install Testing in Codex?

Run `npx skills add static-web-server/static-web-server --skill testing -a codex`. Or copy the skill folder (.agents/skills/testing in static-web-server/static-web-server) into .agents/skills/testing in your project. Codex loads it when a task matches its description.

Can I use Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add static-web-server/static-web-server --skill testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing, .gemini/skills/testing, .github/skills/testing and .opencode/skills/testing in your project.

What does Testing need to run?

Going by SKILL.md and its folder, Testing needs the command-line tools its instructions call (cargo).

Does Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing use?

Testing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Testing?

Skills that share tags, products or a category with Testing: RTK Filter TDD in Rust (rtk-ai/rtk, 83k stars), Aspire Integration Testing (DevBetterCom/DevBetterWeb, 157 stars), Robotics Testing (arpitg1304/robotics-agent-skills, 368 stars) and cargo-pgrx Commands and Tests (yugabyte/yugabyte-db, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing?

static-web-server (a GitHub organization) maintains it in static-web-server/static-web-server, which has 2,373 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 5, 2026.

Source: static-web-server/static-web-server on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.