Skip to content

Commit

Permalink
Auto-generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 3, 2024
1 parent 73ab15a commit 44fd44b
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions doc/neotest-busted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
},
})
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
<
Expand All @@ -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 <path-to-neotest-busted>/scripts/test-runner.lua tests/my_spec.lua
<


Expand Down Expand Up @@ -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 <https://zignar.net/2023/01/21/using-luarocks-as-lua-interpreter-with-luarocks/>
Expand Down

0 comments on commit 44fd44b

Please sign in to comment.