toolsnaps

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 5 Imported by: 0

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

func Test(toolName string, tool any) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL