mirror of
https://github.com/denisidoro/navi
synced 2024-11-21 19:13:07 +00:00
[CI] Fix tests (#624)
This commit is contained in:
parent
ec35cd0edc
commit
6674ca9410
2 changed files with 26 additions and 9 deletions
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
|
@ -49,12 +49,26 @@ jobs:
|
|||
with:
|
||||
command: test
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
_install() {
|
||||
if command -v "$1"; then
|
||||
return 0;
|
||||
fi
|
||||
sudo apt-get install "$1" || sudo apt install "$1" || brew install "$1"
|
||||
};
|
||||
|
||||
_install_many() {
|
||||
for dep in $@; do
|
||||
_install "$dep"
|
||||
done
|
||||
}
|
||||
|
||||
_install_many git bash npm tmux
|
||||
|
||||
- name: Install fzf
|
||||
run: git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf; yes | ~/.fzf/install;
|
||||
|
||||
- name: Install tmux
|
||||
run: sudo apt-get install tmux || sudo apt install tmux || brew install tmux
|
||||
|
||||
- name: Install tealdeer
|
||||
run: sudo npm install -g tldr
|
||||
|
||||
|
|
15
tests/run
15
tests/run
|
@ -62,8 +62,11 @@ _navi_cheatsh() {
|
|||
}
|
||||
|
||||
_navi_widget() {
|
||||
echo "$(_navi widget "$1")" \
|
||||
| grep -q "#!/usr/bin/env $1"
|
||||
local -r out="$(_navi widget "$1")"
|
||||
if ! echo "$out" | grep -q "navi "; then
|
||||
echo "$out"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
_navi_cheatspath() {
|
||||
|
@ -151,17 +154,17 @@ done
|
|||
test::set_suite "info"
|
||||
test::run "cheats_path" _navi_cheatspath
|
||||
|
||||
test::set_suite "integration"
|
||||
test::run "welcome->pwd" _integration
|
||||
|
||||
test::set_suite "widget"
|
||||
test::run "bash" _navi_widget "bash"
|
||||
test::run "zsh" _navi_widget "zsh"
|
||||
test::run "zsh" _navi_widget "fish"
|
||||
test::run "fish" _navi_widget "fish"
|
||||
test::run "elvish" _navi_widget "elvish"
|
||||
|
||||
test::set_suite "3rd party"
|
||||
test::run "tldr" _navi_tldr
|
||||
test::run "cheatsh" _navi_cheatsh
|
||||
|
||||
test::set_suite "integration"
|
||||
test::run "welcome->pwd" _integration
|
||||
|
||||
test::finish
|
||||
|
|
Loading…
Reference in a new issue