diff --git a/Makefile b/Makefile
index 5297661b53274ee1f5d2122932173a50cbcb0d64..3b463b2d1180127bb8acd89a5f4955308fca35fd 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,7 @@ lint: $(JSONNETLINT_BIN) vendor
 .PHONY: test
 test: $(JB_BIN)
 	$(JB_BIN) install
-	./test.sh
+	./scripts/test.sh
 
 .PHONY: test-e2e
 test-e2e:
diff --git a/test.sh b/scripts/test.sh
similarity index 80%
rename from test.sh
rename to scripts/test.sh
index 58b06fe8cce60d57cdfac33553f9f0fc9e731206..6774c63ad9d253e989cc9d3ee41c37b2479d5408 100755
--- a/test.sh
+++ b/scripts/test.sh
@@ -5,6 +5,8 @@ set -o pipefail
 
 # Make sure to use project tooling
 PATH="$(pwd)/tmp/bin:${PATH}"
+TESTFILE="$(pwd)/tmp/test.jsonnet"
+mkdir -p "$(pwd)/tmp"
 
 for i in examples/jsonnet-snippets/*.jsonnet; do
     [ -f "$i" ] || break
@@ -14,13 +16,13 @@ for i in examples/jsonnet-snippets/*.jsonnet; do
     snippet="local kp = $fileContent;
 
 $(<examples/jsonnet-build-snippet/build-snippet.jsonnet)"
-    echo "${snippet}" > "test.jsonnet"
+    echo "${snippet}" > "${TESTFILE}"
     echo "\`\`\`"
     echo "${snippet}"
     echo "\`\`\`"
     echo ""
-    jsonnet -J vendor "test.jsonnet" > /dev/null
-    rm -rf "test.jsonnet"
+    jsonnet -J vendor "${TESTFILE}" > /dev/null
+    rm -rf "${TESTFILE}"
 done
 
 for i in examples/*.jsonnet; do