cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
6e12e8f222c375979299116d554d06843a4b5115

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

scripts/test

29lines · modecode

1#!/usr/bin/env bash
2
3function prism_is_running() {
4 curl --silent "http://localhost:4010" >/dev/null 2>&1
5}
6
7kill_server_on_port() {
8 pids=$(lsof -t -i tcp:"$1" || echo "")
9 if [ "$pids" != "" ]; then
10 kill "$pids"
11 echo "Stopped $pids."
12 fi
13}
14
15if ! prism_is_running; then
16 # When we exit this script, make sure to kill the background mock server process
17 trap 'kill_server_on_port 4010' EXIT
18
19 # Start the dev server
20 ./scripts/mock --daemon
21
22 # Sanity check and print a nice error message
23 if ! ./bin/check-test-server; then
24 exit
25 fi
26fi
27
28# Run tests
29./node_modules/.bin/jest
30