Skip to main content

Set up automated testing

Set up your project for Play Mode and Edit Mode tests against your own UdonSharpBehaviours, written with Udon Test Kit.

1. Put your scripts and generated code in one assembly​

The code Core generates declares the base types your world scripts extend (TsBehaviour, TsInstance, and so on), and in turn references concrete types from your own scripts: a Construct or Factory entry generates a field typed as whatever class you registered. That's a two-way dependency, and Unity doesn't allow two assembly definitions to reference each other. Give your project's own scripts folder a single asmdef placed high enough in the folder tree to cover both your hand-written scripts and wherever the generated-folder setting in your TsConfig points (they don't need to be nested inside each other, just both under that one asmdef's root), referencing Tsvrc.Runtime plus whatever VRChat SDK/ UdonSharp assemblies your scripts use.

2. Create your test assemblies​

Core depends on Udon Test Kit, so the kit is already in your project. Create your test assemblies with its menu item, as described in Create your test assemblies. They already reference the kit, the VRChat SDK, ClientSim and your project's assembly from step 1.

3. Reference Tsvrc.Runtime​

Add Tsvrc.Runtime to the references of the EditMode and PlayMode test assemblies if it isn't listed already, and to the Doubles assembly if your test doubles extend Core types.

That's all. The Core codegen holds back on its own while tests run, so nothing else needs arming. Testing your world covers how a test builds your behaviours.