Documentation
¶
Overview ¶
Package toolsnaps provides test utilities for ensuring json schemas for tools have not changed unexpectedly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Test ¶
Test checks that the JSON schema for a tool has not changed unexpectedly. It compares the marshaled JSON of the provided tool against a stored snapshot file. If the UPDATE_TOOLSNAPS environment variable is set to "true", it updates the snapshot file instead. If the snapshot does not exist and not running in CI, it creates the snapshot file. If the snapshot does not exist and running in CI (GITHUB_ACTIONS="true"), it returns an error. If the snapshot exists, it compares the tool's JSON to the snapshot and returns an error if they differ. Returns an error if marshaling, reading, or comparing fails.
Types ¶
This section is empty.