Home

Awesome

๐ŸŒ–๐Ÿงช busted interop examples

Examples for combining Neovim/Lua test frameworks with busted

Summary

We advocate for using luarocks and busted for testing, primarily for the following reasons:

We do, however, acknowledge that some plugin authors may have additional requirements. For example, something that is not easy with our recommended busted setup is process isolation.

Fortunately, other test frameworks are available on luarocks and can be combined with (and run from within) busted.

[!TIP]

If you find yourself limited due to a lack of process isolation, first consider rethinking your architecture.

A well-designed code base keeps its core logic as pure as possible, which makes it easy to reason about and easy to test. Side-effects (IO, environment, state, ...) should be "woven in" through an interface1.

Prerequisites

We assume you are familiar with our recommended method for running tests with busted. If not, here are some resources to get you started:

Frameworks that work with busted out of the box

Examples for making other frameworks interoperable with busted

The following examples have not been designed with busted interoperability in mind, but can still be combined with busted.

TODO:

Footnotes

  1. This can be done easily, without having to understand monads (see for example the Universal Architecture). Nevertheless, in some cases (especially when it comes to UI), it can be challenging. โ†ฉ