Testing | laravel-og-image-rust | Spatie       

 SPATIE  

laravel-og-image-rust
=====================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-og-image-rust](https://spatie.be/docs/laravel-og-image-rust/v1)  Testing

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-og-image-rust/v1) 

  Testing    
- [ Introduction ](https://spatie.be/docs/laravel-og-image-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-og-image-rust/v1/support-us)
- [ Installation ](https://spatie.be/docs/laravel-og-image-rust/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/laravel-og-image-rust/v1/usage)
- [ Testing ](https://spatie.be/docs/laravel-og-image-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/laravel-og-image-rust/v1/changelog)

 Testing
=======

Run these checks from the package directory:

```
cargo fmt --all -- --check
cargo clippy --locked --all-targets --all-features -- -D warnings
cargo test --locked --all-targets --all-features
cargo test --locked --doc --all-features
cargo doc --locked --no-deps --all-features
cargo package --list --locked --allow-dirty
```

- Clippy enables both `all` and `pedantic`. Exceptions are local, documented `#[expect(...)]` attributes, not crate-wide suppressions.
- Set `RUSTFLAGS` and `RUSTDOCFLAGS` to `-D warnings`, as CI does. In POSIX shells, prefix commands with `RUSTFLAGS='-D warnings' RUSTDOCFLAGS='-D warnings'`. In PowerShell, set `$env:RUSTFLAGS = '-D warnings'` and `$env:RUSTDOCFLAGS = '-D warnings'` first.
- The package is Git-only and depends on unpublished package tools. `cargo package --list` verifies the source inventory, including embedded views.
- Creating a crates.io archive is unsupported because Cargo removes Git dependency sources from that archive. Do not publish this crate to crates.io.
- README.md and all Markdown pages in docs/ participate in rustdoc tests. Setup lines prefixed with `# ` compile and execute but are hidden in rendered rustdoc. Assertions check the examples' results.

Check the minimum supported Rust version:

```
rustup toolchain install 1.99.0 --profile minimal
cargo +1.99.0 test --locked --all-targets --all-features
cargo +1.99.0 test --locked --doc --all-features
```

Check security advisories:

```
cargo install cargo-audit --locked
cargo audit
```

CI runs stable checks on Linux, macOS and Windows, and the MSRV and audit checks on Linux. An audit requires access to the RustSec advisory database.

- `#[laravel::test]` cases use `storage::fake` for the configured S3 disk, `http::client::fake().prevent_stray_requests()` for Cloudflare and page requests, and `queue::fake` for dispatch. They never contact Cloudflare or object storage.
- `app.job(...)` executes both supplied jobs and an application-defined job with custom queue/connection options. Job payloads serialize and restore through the framework runner, without a Redis/database worker daemon.
- Local transport fixtures cover HTTP encoding; the optional Chrome test uses a real local disk.
- Coverage includes provider defaults and overrides, view escaping, direct URLs, previews, fallback precedence, response filtering, commands, throttling, pending-lock release, invalid provider output, cache expiry, and streaming.
- Error tests check malformed filenames, numeric attribute sources, wrong output dimensions, and zero or invalid `Retry-After` headers.
- CI fetches public Git dependencies anonymously, or uses `SPATIE_GITHUB_TOKEN` if configured.

Real Chrome capture is explicit and runs in Linux CI. Run it locally with:

```
OG_IMAGE_CHROME=/usr/bin/google-chrome cargo test --locked --test workflow captures_real_chrome -- --ignored
```

Set `OG_IMAGE_OUTPUT` to a directory to retain the generated PNG, JPEG, and WebP images for inspection. This test uses the real Browsershot backend, validates the decoded dimensions, writes files to a real local framework disk, and requests the framework image route. No external assets are used. The regular suite does not require Chrome; rustdoc capture examples that need an application or credentials compile without running those external operations.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
