27 Star 57 Fork 1

Gitee 极速下载/wekan

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/wekan/wekan.git
克隆/下载
test-wekan.sh 2.40 KB
一键复制 编辑 原始数据 按行查看 历史
Jan Küster 提交于 2021-06-23 12:06 . script added for running tests
#!/usr/bin/env bash
set -e
# ------------------------------------------
#
# Variable declarations
#
# ------------------------------------------
PROJECT_ROOT=$(pwd)
PORT=4040
RUN_ONCE='--once'
VERBOSE_MODE=0
WATCH_MODE=0
COVERAGE=0
# ------------------------------------------
#
# Read args from script call
#
# ------------------------------------------
while getopts "vcw" opt; do
case $opt in
v)
VERBOSE_MODE=1
;;
c)
COVERAGE=1
;;
w)
WATCH_MODE=1
RUN_ONCE=''
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
# ------------------------------------------
#
# Print variables on verbose mode
#
# ------------------------------------------
if [ "$VERBOSE_MODE" -eq "1" ];
then
PROJECT_NAME=`basename "$PROJECT_ROOT"`
echo "=> Test $PROJECT_NAME"
echo "=> Path: [${PROJECT_ROOT}]"
echo "=> Port: [${PORT}]"
echo "=> Watch mode: [${WATCH_MODE}] ${RUN_ONCE}"
echo "=> COVERAGE: [${COVERAGE}]"
fi
if [ "$WATCH_MODE" -eq "0" ];
then
# ---------------------------------------------------------------
# in cli mode we use a headless browser to include client tests
# and we activate the coverage reporting functionality
# ---------------------------------------------------------------
BABEL_ENV=COVERAGE \
TEST_BROWSER_DRIVER=puppeteer \
TEST_SERVER=1 \
TEST_CLIENT=1 \
COVERAGE=${COVERAGE} \
COVERAGE_OUT_HTML=1 \
COVERAGE_OUT_LCOVONLY=1 \
COVERAGE_OUT_TEXT_SUMMARY=1 \
COVERAGE_OUT_JSON_SUMMARY=1 \
COVERAGE_APP_FOLDER=$PWD/ \
COVERAGE_VERBOSE_MODE=${VERBOSE_MODE} \
meteor test \
--exclude-archs=web.browser.legacy,web.cordova \
--driver-package=meteortesting:mocha \
--settings=settings.json \
--port=${PORT} \
--once
cat ./.coverage/summary.txt
else
# ---------------------------------------------------------------
# in watch mode we neither use a browser driver, nor coverage
# se we speed up the test reload in the development phase
# ---------------------------------------------------------------
TEST_BROWSER_DRIVER=puppeteer \
TEST_SERVER=1 \
TEST_CLIENT=1 \
meteor test \
--exclude-archs=web.browser.legacy,web.cordova \
--driver-package=meteortesting:mocha \
--settings=settings.json \
--port=${PORT}
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/wekan.git
git@gitee.com:mirrors/wekan.git
mirrors
wekan
wekan
main

搜索帮助