diff --git a/package.json b/package.json index 3ec61e3..c3e62ee 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "type": "module", "scripts": { "deploy": "wrangler deploy", - "dev": "wrangler dev --var BASE_URL:http://localhost:8787" + "dev": "wrangler dev --var BASE_URL:http://localhost:8787 --port 8787" }, "author": "SharzyL ", "license": "MIT", diff --git a/test/integration.test.js b/test/integration.test.js index 6885ff1..2065797 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -1,3 +1,5 @@ +// it is working-in-progress and not ready to be used + import fs from "fs" import path from "path" import assert from "assert" diff --git a/test/test.env b/test/test.env deleted file mode 100644 index d853e0b..0000000 --- a/test/test.env +++ /dev/null @@ -1,2 +0,0 @@ -SALT=aaaaaaaaaaaaaaaaaaaaaaaaaa -BASE_URL=http://localhost:8787/ diff --git a/test/test.sh b/test/test.sh index 721e991..f42c0a1 100755 --- a/test/test.sh +++ b/test/test.sh @@ -4,16 +4,16 @@ localaddr="http://localhost:8787" tmp_file=$(mktemp) trap 'rm "$tmp_file"' EXIT -die() { - echo "$@" >&2 - exit 1 -} - # declare colors C_RESET='\x1b[0m' C_RED='\x1b[0;37;31m' C_GREEN='\x1b[0;37;32m' +die() { + printf "${C_RED}%s${C_RESET}\n" "$@" >&2 + exit 1 +} + err() { printf "${C_RED}%s${C_RESET}\n" "$@" } @@ -286,6 +286,8 @@ _test_suggest() { it 'should suggest .jpg url' grep -q '"suggestUrl": .*\.jpg' "$tmp_file" } +pgrep -f workerd > /dev/null || die "no workerd is running, please start one instance with ‘yarn dev’" + if [ $# -gt 0 ]; then test_chapters "$@" else diff --git a/wrangler.toml b/wrangler.toml index 4d73529..c9a2e5a 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -37,5 +37,3 @@ TOS_MAINTAINER = "Sharzy" # the email displayed in TOS TOS_MAIL = "pb@shz.al" -[vars.BASIC_AUTH] -user1 = "passwd1"