#!/usr/bin/env bashset -ecd "$(dirname "0ドル")/.."RED='033円[0;31m'GREEN='033円[0;32m'YELLOW='033円[0;33m'NC='033円[0m' # No Colorfunction prism_is_running() {curl --silent "http://localhost:4010" >/dev/null 2>&1}kill_server_on_port() {pids=$(lsof -t -i tcp:"1ドル" || echo "")if [ "$pids" != "" ]; thenkill "$pids"echo "Stopped $pids."fi}function is_overriding_api_base_url() {[ -n "$TEST_API_BASE_URL" ]}if ! is_overriding_api_base_url && ! prism_is_running ; then# When we exit this script, make sure to kill the background mock server processtrap 'kill_server_on_port 4010' EXIT# Start the dev server./scripts/mock --daemonfiif is_overriding_api_base_url ; thenecho -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"echoelif ! prism_is_running ; thenecho -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"echo -e "running against your OpenAPI spec."echoecho -e "To run the server, pass in the path or url of your OpenAPI"echo -e "spec to the prism command:"echoecho -e " \$${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}"echoexit 1elseecho -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"echofiecho "==> Running tests"./gradlew --build-cache --parallel --no-daemon test
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。