Valheim.Testing
0.1.0-preview.5
See the version list below for details.
dotnet add package Valheim.Testing --version 0.1.0-preview.5
NuGet\Install-Package Valheim.Testing -Version 0.1.0-preview.5
<PackageReference Include="Valheim.Testing" Version="0.1.0-preview.5" />
<PackageVersion Include="Valheim.Testing" Version="0.1.0-preview.5" />
<PackageReference Include="Valheim.Testing" />
paket add Valheim.Testing --version 0.1.0-preview.5
#r "nuget: Valheim.Testing, 0.1.0-preview.5"
#:package Valheim.Testing@0.1.0-preview.5
#addin nuget:?package=Valheim.Testing&version=0.1.0-preview.5&prerelease
#tool nuget:?package=Valheim.Testing&version=0.1.0-preview.5&prerelease
ValheimTesting
Reusable test inputs, fixtures and assertions for Valheim mods. Most tests run without Valheim, Unity, Steam or a dedicated server. Optional system tests use the real game through ValheimCLI.
Unofficial community tooling; not affiliated with or endorsed by Iron Gate or Coffee Stain. Valheim is a trademark of Iron Gate AB.
New to the framework? Follow Add testing to a mod, then choose a runnable example from the example index. Existing mod tests stay in their own repository; shared helpers and lifecycle code are adopted gradually.
Contribute
Mod developers and coding agents are welcome to help extend the synthetic world, capture/replay, observations and lifecycle tools. Read CONTRIBUTING.md for repository ownership, a worked fixture example, local checks and PR expectations. Useful local contributions can be reviewed before native testing; mark that evidence as not run.
AI agent entry point
Start with AGENTS.md and the agent workflow. A CLAUDE.md pointer keeps Claude-based assistants on the same instructions. The guide covers tool discovery, strict pins, one-shot mutations, result interpretation, test-layer limits and restoration/handoff.
Packages and ownership
| Package | Purpose | Runtime |
|---|---|---|
Valheim.Testing |
Composable terrain, multi-zone height/paint fixtures and exact recorded-input replay; no ValheimCLI dependency | netstandard2.0 |
Valheim.Testing.Game |
Typed observations, fixtures, owned server sessions, comparisons and JSON/JUnit reports | net10.0 |
Valheim.Testing.Cli |
ValheimCLI's client transport and YAML runner, packaged unchanged from pinned ValheimCLI source (MIT, warp) | net9.0 |
The dependency goes ValheimTesting → ValheimCLI, never the reverse. Game-side extension API and observers stay in ValheimCLI. Roads and MWL own their optional adapters and scenarios. No test package belongs in an ordinary player's plugin folder.
Until upstream merges the required transport/API changes, cli-dependency.json pins our ValheimCLI fork by full commit and exact package version. All three packages are on NuGet.org: Valheim.Testing, Valheim.Testing.Cli and Valheim.Testing.Game. ValheimTesting publishes the transport as Valheim.Testing.Cli so it is clearly this toolkit's packaging, not an official ValheimCLI release; upstream's own project is Valheim.Cli.Testing. Bootstrap builds it from tracked source at the pinned commit into an ignored local feed; it does not compile or launch the game plugin.
Start without a game
Requires only the .NET 10 SDK and Git; the bootstrap and validation scripts are .NET file-based C# programs. The pure library targets netstandard2.0; the game library and examples target net10.0 and allow a newer runtime. The ValheimCLI transport package targets net9.0 and runs on .NET 10.
dotnet run scripts/bootstrap-cli.cs
# Or use a local CLI clone; the script exports only the pinned commit:
# dotnet run scripts/bootstrap-cli.cs -- --source /path/to/valheimCLI
dotnet run scripts/validate.cs
dotnet run --project examples/NoGameTerrain -c Release
validate.cs runs the local library tests, builds all external examples and packs the two libraries to .packages. It never starts Valheim. The ValheimCLI transport and its tests remain upstream-owned, not copied here. To test a mod, pin Valheim.Testing 0.1.0-preview.5 or Valheim.Testing.Game 0.1.0-preview.10 (net10.0); both restore from NuGet.org. The transport stays at Valheim.Testing.Cli 0.1.0-preview.4. Use the local feed only to try a build that is not yet published.
Test pyramid
- Unit/synthetic: real mod decisions against small explicit inputs. Broad and fast.
- Integration: transport, adapters, fixture handling and orchestration with controlled doubles.
- Bounded game checks: a few zones on a disposable server and ValheimCLI-only client; save/restart and replication when those boundaries change.
- Human judgement: short visual/walking checks when usability matters.
Synthetic inputs are not Valheim's generator. Replaying captured inputs is not independent proof of the game's physics. Incomplete observations fail explicitly. Session ownership does not own Steam accounts, machine reservations or another operator's running game.
Evidence and limits
Local validation covers synthetic inputs, observation contracts and lifecycle failure handling. Roads supplies the first native scenarios: a 100-sample declared terrain/collider calibration, followed by a persistent two-zone native fixture. On Valheim 1.0.16, a ValheimCLI-only client matched 15 height/collider samples and three stationary grounded observations before and after confirmed server save/restart/rejoin. The later paint arm matched all 16 paved-core/verge RGBA samples across the same lifecycle. An unchanged-paint negative expectation failed exactly the eight painted samples and passed the untouched eight.
The paint fixture starts from explicit saved RGBA, preserves alpha and samples both sides of a zone seam. It does not establish arbitrary terrain, native dirt/fading-edge behavior, rendered appearance or human walking usability. MWL's full-mode payment/delivery/ownership gate remains pending. See the detailed guide, source provenance, and examples.
Preview APIs may change. No release or upstream merge is implied by this repository.
Follow-up examples: PaintCheck compares loaded raw paint channels; WalkingReview records a human-driven traversal without moving the character. Both build locally; the bounded paved paint/reload check passed, while human walking acceptance remains pending.
License
MIT, copyright © 2026 Tys von Gaza. See LICENSE. Attribution for imported and adapted code is retained in THIRD-PARTY-NOTICES.md; both files are included in the library packages.
Shared-world fixtures: guide and mod consumers, runnable example. Height and paint grids are independent; snapshots are in-memory test state, not native saves.
The 27 September native follow-up covers strict reloads, terrain capture/replay, session controls, controlled mutation draining and dirt/fade paint persistence. It records the remaining limits explicitly.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Valheim.Testing:
| Package | Downloads |
|---|---|
|
Valheim.Testing.Game
Fixtures and typed assertions for Valheim integration tests using the shared CLI transport. Unofficial community tooling; not affiliated with or endorsed by Iron Gate or Coffee Stain. Valheim is a trademark of Iron Gate AB. |
|
|
Valheim.Testing.Doubles
Source-only doubles of the Unity, Valheim, BepInEx and Jotunn types a mod's pure-logic sources use, so those sources compile and run in an ordinary test project without the game. Every type is partial; mods add the members they need. Unofficial community tooling; not affiliated with or endorsed by Iron Gate or Coffee Stain. Valheim is a trademark of Iron Gate AB. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.3.0 | 111 | 10/24/2026 |
| 0.2.0 | 176 | 10/21/2026 |
| 0.1.0 | 454 | 10/14/2026 |
| 0.1.0-rc.1 | 99 | 10/14/2026 |
| 0.1.0-preview.14 | 1,518 | 10/10/2026 |
| 0.1.0-preview.13 | 2,637 | 10/6/2026 |
| 0.1.0-preview.12 | 1,847 | 10/4/2026 |
| 0.1.0-preview.7 | 8,166 | 9/30/2026 |
| 0.1.0-preview.6 | 1,438 | 9/29/2026 |
| 0.1.0-preview.5 | 66 | 9/28/2026 |