Skip to content

Commit

Permalink
just test
Browse files Browse the repository at this point in the history
  • Loading branch information
grierson committed Aug 11, 2023
1 parent b3ff5e2 commit 343efa5
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .nfnl.fnl
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
(local {: autoload} (require :nfnl.module))
(local reload (autoload :plenary.reload))
(local notify (autoload :nfnl.notify))

(vim.api.nvim_set_keymap :n :<localleader>tf
"<cmd>PlenaryBustedDirectory lua/spec/<cr>"
{:desc "Run all tests with plenary."})

{}
46 changes: 46 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
prepare:
#!/usr/bin/env bash
test -d .build/nvim || {
mkdir -p ./.build/nvim
os=$(uname)
if [[ "$os" == "Darwin" ]]; then
curl -L https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz > ./.build/nvim-macos.tar.gz
xattr -c ./.build/nvim-macos.tar.gz
tar xzf ./.build/nvim-macos.tar.gz -C ./.build/nvim --strip-components=1
rm ./.build/nvim-macos.tar.gz
elif [[ "$os" == "Linux" ]]; then
curl -L https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz > ./.build/nvim-linux64.tar.gz
tar xzf ./.build/nvim-linux64.tar.gz -C ./.build/nvim --strip-components=1
rm ./.build/nvim-linux64.tar.gz
else
echo "Unsupported operating system: $os"
exit 1
fi
}
test -d .build/dependencies || {
mkdir -p ./.build/dependencies
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ./.build/dependencies/plenary.nvim
git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter ./.build/dependencies/nvim-treesitter
}

test: prepare
./.build/nvim/bin/nvim --version
./.build/nvim/bin/nvim \
--headless \
--noplugin \
-u lua/spec/init.lua \
-c "PlenaryBustedDirectory lua/spec { minimal_init='lua/spec/init.lua', sequential=true }"

focus feature: prepare
./.build/nvim/bin/nvim --version
./.build/nvim/bin/nvim \
--headless \
--noplugin \
-u lua/spec/init.lua \
-c "PlenaryBustedDirectory lua/spec/{{feature}} { minimal_init='lua/spec/init.lua', sequential=true }"

watch feature:
fswatch -o lua/api/{{feature}}.lua lua/spec/api/{{feature}}/{{feature}}_spec.lua | xargs -n1 -I{} just focus {{feature}}

16 changes: 16 additions & 0 deletions lua/spec/init.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lua/spec/nfnl/example_spec.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 343efa5

Please sign in to comment.