Files
headlessui/scripts/test.sh
T
Robin Malfait b229857b90 fix typo
2020-09-25 12:42:31 +02:00

35 lines
744 B
Bash
Executable File

#!/bin/bash
set -e
ROOT_DIR="$(git rev-parse --show-toplevel)/"
TARGET_DIR="$(pwd)"
RELATIVE_TARGET_DIR="${TARGET_DIR/$ROOT_DIR/}"
# INFO: This script is always run from the root of the repository. If we execute this script from a
# package then the filters (in this case a path to $RELATIVE_TARGET_DIR) will be applied.
pushd $ROOT_DIR > /dev/null
node="yarn node"
tsdxArgs=()
# Add script name
tsdxArgs+=("test")
# Add default arguments
tsdxArgs+=("--passWithNoTests" $RELATIVE_TARGET_DIR)
# Add arguments based on environment variables
if [ -n "$CI" ]; then
jestArgs+=("--maxWorkers=4")
jestArgs+=("--ci")
fi
# Passthrough arguments and flags
tsdxArgs+=($@)
# Execute
$node "$(yarn bin tsdx)" "${tsdxArgs[@]}"
popd > /dev/null