Skip to content

Commit 44fd44b

Browse files
Auto-generate docs
1 parent 73ab15a commit 44fd44b

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

doc/neotest-busted.txt

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ Setup with neotest. Leave values as `nil` to leave them unspecified.
4141
-- Custom config to load via -u to set up testing.
4242
-- If nil, will look for a 'minimal_init.lua' file
4343
minimal_init = "custom_init.lua",
44+
-- Only use a luarocks installation in the project's directory. If
45+
-- true, installations in $HOME and global installations will be
46+
-- ignored. Useful for isolating the test environment
47+
local_luarocks_only = true,
4448
}),
4549
},
4650
})
@@ -100,6 +104,13 @@ precedence over a global install). You can check the installation by running
100104
`luarocks list busted`.
101105

102106

107+
[!WARNING] If you have set `busted_command` to a non-nil value in the `setup`
108+
function, `neotest-busted` will not know where to look for appropriate lua
109+
paths and will not look for installations as specified below to avoid setting
110+
up paths for a different busted installation.
111+
In this case, you should set `busted_paths` and `busted_cpaths` to appropriate
112+
paths.
113+
103114
DIRECTORY-LOCAL INSTALL ~
104115

105116
You can install busted in your project’s directory by running the following
@@ -115,6 +126,9 @@ commands.
115126

116127
USER HOME DIRECTORY INSTALL ~
117128

129+
130+
[!IMPORTANT] You need to set `local_luarocks_only` to `false` for
131+
`neotest-busted` to find your home directory installation.
118132
The following command will install busted in your home directory.
119133

120134
>shell
@@ -124,6 +138,9 @@ The following command will install busted in your home directory.
124138

125139
GLOBAL INSTALL ~
126140

141+
142+
[!IMPORTANT] You need to set `local_luarocks_only` to `false` for
143+
`neotest-busted` to find your global installation.
127144
>shell
128145
> luarocks install busted
129146
<
@@ -141,22 +158,7 @@ run, the command will automatically try to find your tests in a `spec/`,
141158
`test/`, or `tests/` directory.
142159

143160
>shell
144-
$ nvim -l ./scripts/test-runner.lua tests/my_spec.lua
145-
<
146-
147-
148-
TEST VIA ROCKSPEC
149-
150-
If you use a rockspec, you can provide a test command so you can run tests
151-
using `luarocks test`.
152-
153-
>lua
154-
-- Your rockspec...
155-
156-
test = {
157-
type = "command",
158-
command = "nvim -u NONE -l ./scripts/test-runner.lua",
159-
}
161+
$ nvim -l <path-to-neotest-busted>/scripts/test-runner.lua tests/my_spec.lua
160162
<
161163

162164

@@ -186,6 +188,13 @@ Busted removed support for async testing in version 2
186188
busted v1 but I haven’t tested that.
187189

188190

191+
Q: WHY IS NEOTEST-BUSTED TESTED USING PLENARY?
192+
193+
The test could be run via `neotest-busted` itself but I decided to use plenary
194+
instead to use another test runner so that bugs in `neotest-busted` won’t
195+
affect its own tests.
196+
197+
189198
INSPIRATION *neotest-busted-inspiration*
190199

191200
- Using Neovim as Lua interpreter with Luarocks <https://zignar.net/2023/01/21/using-luarocks-as-lua-interpreter-with-luarocks/>

0 commit comments

Comments
 (0)