diff --git a/doc/neotest-busted.txt b/doc/neotest-busted.txt index 87ae2da..7974373 100644 --- a/doc/neotest-busted.txt +++ b/doc/neotest-busted.txt @@ -41,6 +41,10 @@ Setup with neotest. Leave values as `nil` to leave them unspecified. -- Custom config to load via -u to set up testing. -- If nil, will look for a 'minimal_init.lua' file minimal_init = "custom_init.lua", + -- Only use a luarocks installation in the project's directory. If + -- true, installations in $HOME and global installations will be + -- ignored. Useful for isolating the test environment + local_luarocks_only = true, }), }, }) @@ -100,6 +104,13 @@ precedence over a global install). You can check the installation by running `luarocks list busted`. + [!WARNING] If you have set `busted_command` to a non-nil value in the `setup` + function, `neotest-busted` will not know where to look for appropriate lua + paths and will not look for installations as specified below to avoid setting + up paths for a different busted installation. + In this case, you should set `busted_paths` and `busted_cpaths` to appropriate + paths. + DIRECTORY-LOCAL INSTALL ~ You can install busted in your project’s directory by running the following @@ -115,6 +126,9 @@ commands. USER HOME DIRECTORY INSTALL ~ + + [!IMPORTANT] You need to set `local_luarocks_only` to `false` for + `neotest-busted` to find your home directory installation. The following command will install busted in your home directory. >shell @@ -124,6 +138,9 @@ The following command will install busted in your home directory. GLOBAL INSTALL ~ + + [!IMPORTANT] You need to set `local_luarocks_only` to `false` for + `neotest-busted` to find your global installation. >shell > luarocks install busted < @@ -141,22 +158,7 @@ run, the command will automatically try to find your tests in a `spec/`, `test/`, or `tests/` directory. >shell - $ nvim -l ./scripts/test-runner.lua tests/my_spec.lua -< - - -TEST VIA ROCKSPEC - -If you use a rockspec, you can provide a test command so you can run tests -using `luarocks test`. - ->lua - -- Your rockspec... - - test = { - type = "command", - command = "nvim -u NONE -l ./scripts/test-runner.lua", - } + $ nvim -l /scripts/test-runner.lua tests/my_spec.lua < @@ -186,6 +188,13 @@ Busted removed support for async testing in version 2 busted v1 but I haven’t tested that. +Q: WHY IS NEOTEST-BUSTED TESTED USING PLENARY? + +The test could be run via `neotest-busted` itself but I decided to use plenary +instead to use another test runner so that bugs in `neotest-busted` won’t +affect its own tests. + + INSPIRATION *neotest-busted-inspiration* - Using Neovim as Lua interpreter with Luarocks