Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #315 from xwp/feature/run_tests
Browse files Browse the repository at this point in the history
Let users supply their own test function
  • Loading branch information
derekherman authored Feb 10, 2020
2 parents 420f1ba + c464950 commit 3e3ced3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sample-config/.dev-lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

function run_tests {
# Run your custom checks before the default linters, tests, etc.
}

function after_wp_install {
# Run any customs code before PHPUnit checks, see `check-diff.sh`.
}
5 changes: 5 additions & 0 deletions scripts/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ install_tools
echo "## Checking files, scope $CHECK_SCOPE:"
cat "$TEMP_DIRECTORY/paths-scope"

# Run any custom checks by defining a run_tests function, see sample-scripts/.dev-lib
if [ "$( type -t run_tests )" != '' ]; then
run_tests
fi

check_execute_bit
lint_js_files
lint_php_files
Expand Down
5 changes: 5 additions & 0 deletions scripts/travis.script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ if [[ -z $SKIP_ECHO_PATHS_SCOPE ]] && [[ $CHECK_SCOPE != "all" ]]; then
fi
echo

# Run any custom checks by defining a run_tests function, see sample-scripts/.dev-lib
if [ "$( type -t run_tests )" != '' ]; then
run_tests
fi

check_execute_bit
lint_js_files
lint_php_files
Expand Down

0 comments on commit 3e3ced3

Please sign in to comment.