Skip to content

Commit

Permalink
[Tests] Add markdown-link-check test
Browse files Browse the repository at this point in the history
This test use the npm package: markdown-link-check to help check if all
the links in the documentation is alive.
  • Loading branch information
PeterDaveHello committed Nov 4, 2017
1 parent 9953a52 commit 049ffbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ before_install:
- curl --version
- wget --version
install:
- if [ -z "${SHELLCHECK-}" ]; then nvm install node && npm install && npm prune && npm ls urchin doctoc; fi
- if [ -z "${SHELLCHECK-}" ]; then nvm install node && npm install && npm prune && npm ls urchin doctoc markdown-link-check; fi
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
script:
- if [ -n "${MAKE_RELEASE-}" ]; then export GIT_EDITOR="sed -i '1 s/^/99.99.99 make release test/'" && git fetch --unshallow --tags && echo proceed | make TAG=99.99.99 release ; fi
- if [ -n "${DOCTOCCHECK-}" ]; then cp README.md README.md.orig && npm run doctoc && diff -q README.md README.md.orig ; fi
- if [ -n "${MARKDOWN_LINK_CHECK-}" ]; then npm run markdown-link-check ; fi
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash nvm.sh && shellcheck -s sh nvm.sh && shellcheck -s dash nvm.sh && shellcheck -s ksh nvm.sh ; fi
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash install.sh bash_completion nvm-exec ; fi
- if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ]; then travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL ; else make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL; fi; fi
Expand All @@ -38,6 +39,7 @@ env:
matrix:
- MAKE_RELEASE=true
- DOCTOCCHECK=true
- MARKDOWN_LINK_CHECK=true
- SHELLCHECK=true
- SHELL=bash TEST_SUITE=install_script
- SHELL=sh TEST_SUITE=fast
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"test/installation/node": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_node test-$shell",
"test/installation/iojs": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=installation_iojs test-$shell",
"test/sourcing": "shell=$(basename -- $(ps -o comm= $(ps -o ppid= -p $PPID)) | sed 's/^-//'); make TEST_SUITE=sourcing test-$shell",
"doctoc": "doctoc --title='## Table of Contents' --github README.md"
"doctoc": "doctoc --title='## Table of Contents' --github README.md",
"markdown-link-check": "find . -type f -name '*.md' | grep -v '^./node_modules\\|^./v' | xargs -n 1 markdown-link-check -p"
},
"repository": {
"type": "git",
Expand All @@ -37,6 +38,7 @@
"replace": "^0.3.0",
"semver": "^5.0.1",
"urchin": "^0.0.5",
"doctoc": "^1.2.0"
"doctoc": "^1.2.0",
"markdown-link-check": "^3.1.4"
}
}

0 comments on commit 049ffbf

Please sign in to comment.