Skip to content

foxssake/vest

Repository files navigation

vest logo vest

License GitHub Release Documentation Discord ko-fi

A unit testing library for Godot.

Features

  • ✨ Define tests with test methods or programmatically with define()
  • 📝 Parameterized tests to conveniently define multiple tests
  • 🎭 Mock classes dynamically, for simpler unit testing
  • ⚡ Run benchmarks, to find the best performing implementations
  • 🗒️ Generate reports in TAP format, to integrate with other test harnesses
  • 🔁 Coroutines for asynchronous cases
  • ▶️ In-editor UI for convenient testing
  • 🤖 Support for running in CI

Overview

A testing addon for Godot, vest aims to bring all the features of a full-fledged testing framework, while staying as lightweight and nonintrusive as possible.

Tests written with vest look as follows:

extends VestTest

# Specify name shown in reports
func get_suite_name() -> String:
  return "pow()"

# With define():
func suite():
  test("exp 0 should return 1", func():
    expect_equal(1, pow(128, 0))
  )
  test("exp 1 should return input", func():
    expect_equal(128, pow(128, 128))
  )

# With test methods:
func test_exp_0_should_return_1():
  expect_equal(1, pow(128, 0))

func test_exp_1_should_return_inpt():
  expect_equal(128, pow(128, 128))

Install

Usage

Extensive documentation can be found at the vest site. A good starting point is the Getting started guide.

Examples are included in the examples/ folder and in the documentation.

Compatibility

Godot v4.1.4 and up

License

vest is licensed under the MIT License.

Issues

In case of any issues, comments, or questions, please feel free to open an issue!

Funding

If you've found vest useful, feel free to fund us on ko-fi:

ko-fi

Donations are always appreciated and taken as gratitude for the work that has already been done.