mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-10-09 03:32:15 +00:00
Merge 6678b8a4c5
into 59334064f8
This commit is contained in:
commit
3c43f67a5d
4 changed files with 23 additions and 23 deletions
1
.busted
1
.busted
|
@ -1,5 +1,6 @@
|
||||||
return {
|
return {
|
||||||
_all = {
|
_all = {
|
||||||
|
lua = "./tests/bootstrap-busted.sh",
|
||||||
coverage = false,
|
coverage = false,
|
||||||
},
|
},
|
||||||
default = {
|
default = {
|
||||||
|
|
|
@ -1363,31 +1363,14 @@ TESTING WITH BUSTED ~
|
||||||
|
|
||||||
This will add `"lunarmodules/busted"`, configure `hererocks` and run `busted`.
|
This will add `"lunarmodules/busted"`, configure `hererocks` and run `busted`.
|
||||||
|
|
||||||
Below is an example of how I use **minit** to run tests with busted
|
Running tests with busted will leverge the [tests/busted.lua](https://github.com/folke/lazy.nvim/blob/add-busted-lua/tests/busted.lua) file, to setup the test environment using [lazy.minit](https://github.com/folke/lazy.nvim/blob/main/lua/lazy/minit.lua).
|
||||||
<https://olivinelabs.com/busted/> in **LazyVim**.
|
|
||||||
|
|
||||||
>lua
|
To run the tests with busted, simply run the following command from the root
|
||||||
#!/usr/bin/env -S nvim -l
|
of the repository:
|
||||||
|
|
||||||
vim.env.LAZY_STDPATH = ".tests"
|
|
||||||
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
|
|
||||||
|
|
||||||
-- Setup lazy.nvim
|
|
||||||
require("lazy.minit").busted({
|
|
||||||
spec = {
|
|
||||||
"LazyVim/starter",
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
<
|
|
||||||
|
|
||||||
To use this, you can run:
|
```sh
|
||||||
|
busted tests
|
||||||
>sh
|
```
|
||||||
nvim -l ./tests/busted.lua tests
|
|
||||||
<
|
|
||||||
|
|
||||||
If you want to inspect the test environment, run:
|
If you want to inspect the test environment, run:
|
||||||
|
|
||||||
|
|
2
tests/bootstrap-busted.sh
Executable file
2
tests/bootstrap-busted.sh
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
nvim -l ./tests/busted.lua $@
|
14
tests/busted.lua
Normal file
14
tests/busted.lua
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env -S nvim -l
|
||||||
|
|
||||||
|
vim.env.LAZY_STDPATH = ".tests"
|
||||||
|
load(vim.fn.system("cat $(pwd)/bootstrap.lua"))()
|
||||||
|
--
|
||||||
|
-- -- Setup lazy.nvim
|
||||||
|
require("lazy.minit").busted({
|
||||||
|
spec = {
|
||||||
|
"LazyVim/starter",
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue