Valheim.Testing.Adapter 0.1.0-preview.7

This is a prerelease version of Valheim.Testing.Adapter.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Valheim.Testing.Adapter --version 0.1.0-preview.7
                    
NuGet\Install-Package Valheim.Testing.Adapter -Version 0.1.0-preview.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Valheim.Testing.Adapter" Version="0.1.0-preview.7">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Valheim.Testing.Adapter" Version="0.1.0-preview.7" />
                    
Directory.Packages.props
<PackageReference Include="Valheim.Testing.Adapter">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Valheim.Testing.Adapter --version 0.1.0-preview.7
                    
#r "nuget: Valheim.Testing.Adapter, 0.1.0-preview.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Valheim.Testing.Adapter@0.1.0-preview.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Valheim.Testing.Adapter&version=0.1.0-preview.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Valheim.Testing.Adapter&version=0.1.0-preview.7&prerelease
                    
Install as a Cake Tool

ValheimTesting

Reusable test inputs, fixtures and assertions for Valheim mods. Most tests run without Valheim, Unity, Steam or a dedicated server; the few that need the game drive it through ValheimCLI, on the same Windows PC where you play.

Unofficial community tooling; not affiliated with or endorsed by Iron Gate or Coffee Stain. Valheim is a trademark of Iron Gate AB.

First test in three steps

  1. Install the .NET 10 SDK (Visual Studio 2026 brings it) on the PC where you build your mod.
  2. Copy ModWithTests beside your mod: a test project that links your mod's real source files and references Valheim.Testing.Doubles from NuGet.org.
  3. Run dotnet test MyMod.Tests/MyMod.Tests.csproj. No game, Steam or ValheimCLI is needed.

Then Bring your mod helps choose the layer for each behaviour, Get started has the package versions and IDE setup, and the examples go up to native checks with an owned server and client on one Windows PC. Other hosts are in platforms. New to BepInEx and Harmony? The community wiki's overview explains the concepts; check its older samples against 1.0 (wiki caveats). A plugin that will not load, or two mods that conflict: debugging guide.

Packages

Each package's page is its reference: what it is for, the types a test calls, how it fails and its limits.

Package (source and reference) Purpose Runtime
Valheim.Testing (reference) Composable terrain, exact recorded-input replay, pinned grid dumps, terrain rendering with contours, parity checks and StaticOverride (scoped static and environment overrides for any test); no ValheimCLI dependency netstandard2.0
Valheim.Testing.Game (reference) One game process from outside: typed observations, fixtures, owned server and client sessions, comparisons and JSON/JUnit reports net10.0
Valheim.Testing.GameSessions (reference) Game sessions: a dedicated server, clients and hosted worlds as one run (GameSession, PinnedServerRun), on this PC or on other machines over SSH or a container, with host locks, Steam-account leases and recovery of what a run left; built on Valheim.Testing.Game net10.0
Valheim.Testing.Cli (reference) ValheimCLI's client transport and YAML runner, packaged unchanged from pinned ValheimCLI source (MIT, warp) net10.0
Valheim.Testing.Adapter (reference) Source compiled into a mod's game-side test adapter plugin: registration with ValheimCLI, the owned-session identity the runners check, and read-only observations source (net48, C# 10)
Valheim.Testing.Doubles (reference) Source-only doubles of the Unity, Valheim, BepInEx and Jotunn types a mod's pure-logic sources use, compiled into your test project; every type is partial; ValheimWorldScope puts back every static they keep (a mod scopes its own with StaticOverride) source (C# 10); member index
Valheim.Testing.Bindings (reference) Offline check that a built mod's references into the game assemblies still bind (Mono.Cecil); missing members fail, access changes are reported separately netstandard2.0
Valheim.Testing.Bindings.Tool (reference) The same check as the valheim-bindings .NET tool, for a mod's CI before any native run net10.0
Valheim.Testing.NativeSmoke (reference) valheim-test: one-command disposable mod-load checks, A/B mod isolation, an editable NuGet-only consumer project, and the environment commands (env, session check) .NET 10 tool

The dependency goes ValheimTesting → ValheimCLI, never the reverse: the game-side extension API stays in ValheimCLI, and a mod keeps its own adapter and scenarios. No test package belongs in a production mod or a player's plugin folder. Valheim.Testing.Cli is ValheimCLI's transport packaged by this repository from the fork commit cli-dependency.json pins, not an official ValheimCLI release. Preview APIs may change; the candidate API reference inventories them for the stable-contract review.

Test layers

  1. Unit: real mod decisions against small declared inputs and the doubles. Broad and fast.
  2. Integration: scenario drivers, adapters and fixtures against scripted replies and fake processes.
  3. Bounded game checks: a few zones on a disposable server and client; save, restart and replication when those boundaries change.
  4. Human judgement: a short look or walk when appearance or usability matters.

Synthetic inputs are not Valheim's generator, a replay of a capture is not independent evidence of the game, and an incomplete observation fails rather than reading as zero.

Contribute

Mod developers and coding agents are welcome. CONTRIBUTING.md has repository ownership, a worked fixture example, local checks (dotnet run scripts/bootstrap-cli.cs, then dotnet run scripts/validate.cs; no game) and PR expectations. Agents start with AGENTS.md and the agent workflow. Before a native run, read the runtime hygiene checklist.

License

MIT, copyright © 2026 Tys von Gaza. See LICENSE. Attribution for imported and adapted code is retained in THIRD-PARTY-NOTICES.md and PROVENANCE.md; both license files are included in the library packages.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 68 10/14/2026
0.1.0-rc.1 43 10/14/2026
0.1.0-preview.9 59 10/11/2026
0.1.0-preview.8 56 10/10/2026
0.1.0-preview.7 75 10/8/2026
0.1.0-preview.6 75 10/6/2026
0.1.0-preview.5 62 10/4/2026
0.1.0-preview.3 85 10/1/2026
0.1.0-preview.2 79 9/30/2026
0.1.0-preview.1 78 9/29/2026