From 15cc339b2af59079cca8feff39bd3681647f8ca6 Mon Sep 17 00:00:00 2001
From: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
Date: Tue, 21 Apr 2020 13:48:23 +0200
Subject: [PATCH] test mod

---
 .luacheckrc         | 17 +++++++++++++++++
 integration-test.sh |  4 ++++
 test_mod/init.lua   |  4 +++-
 3 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100644 .luacheckrc

diff --git a/.luacheckrc b/.luacheckrc
new file mode 100644
index 0000000..3f1b303
--- /dev/null
+++ b/.luacheckrc
@@ -0,0 +1,17 @@
+
+read_globals = {
+	-- Stdlib
+	string = {fields = {"split"}},
+	table = {fields = {"copy", "getn"}},
+
+	-- Minetest
+	"minetest",
+	"vector", "ItemStack",
+	"dump",
+
+	-- Deps
+	"unified_inventory", "default",
+
+	-- optional mods
+	"xban", "mail"
+}
diff --git a/integration-test.sh b/integration-test.sh
index 63e032e..80de09e 100755
--- a/integration-test.sh
+++ b/integration-test.sh
@@ -42,5 +42,9 @@ docker run --rm -i \
 
 test -f ${WORLDDIR}/integration_test.json && exit 0 || exit 1
 
+# https://jwt.io/
+# TODO
+#TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwidXNlcm5hbWUiOiJkc3QiLCJpYXQiOjE1MTYyMzkwMjJ9.7ik564LuatEhOFapNWIqSlYcST41cgmHGAuTnAowTu8"
+#curl -v -H "Authorization: ${TOKEN}" "http://127.0.0.1:8080/api/inbox"
 
 echo "Test complete!"
diff --git a/test_mod/init.lua b/test_mod/init.lua
index b3e48c1..9561145 100644
--- a/test_mod/init.lua
+++ b/test_mod/init.lua
@@ -3,7 +3,9 @@ minetest.log("warning", "[TEST] integration-test enabled!")
 
 minetest.register_on_mods_loaded(function()
 	minetest.log("warning", "[TEST] starting tests")
-	minetest.after(0, function()
+	mail.send("src", "dst", "subject", "body");
+	minetest.after(1, function()
+
 		minetest.log("warning", "[TEST] integration tests done!")
 		minetest.request_shutdown("success")