mocks/

directory
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MPL-2.0

README

Mock Code Generation

Code Generation Library

mockery is a library which contains a set of utilities for generating interface mocks

Code Generation

To simplify code generation, the generation should be set up to use go:generation

To set this up, add the following line to the file containing the interface to be mocked

//go:generate mockery --name=<name_of_interface_to_mock> --filename=<name_of_file_to_create> --output=<relative_path_to_mocks>/<package_name> --tags=

eg. //go:generate mockery --name=Driver --filename=driver.go --output=../mocks/driver --tags=tag1,tag2

To run code generation for CTS, including the mock code generation:

  1. Install open-api: go install github.com/vektra/mockery/v2@latest
  2. Generate files: make generate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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