-
Notifications
You must be signed in to change notification settings - Fork 27
/
test.bats
27 lines (20 loc) · 644 Bytes
/
test.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bats
# lint markdown files
# --------
if ! markdownlint --help &> /dev/null; then
echo "Error: markdownlint-cli not installed. Run npm install -g markdownlint-cli and try again."
exit 1
fi
if ! shellcheck --version &> /dev/null; then
echo "Error: shellcheck not installed. View installation instructions here:"
echo "https://github.com/koalaman/shellcheck#installing"
exit 1
fi
@test "markdown files conform to rules defined in .markdownlintrc" {
run markdownlint *.md .github
[ "$status" -eq 0 ]
}
@test "install.sh passes shellcheck" {
run shellcheck install.sh
[ "$status" -eq 0 ]
}