summary refs log tree commit diff
path: root/cdn/tests/filestorage.test.js
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-30 15:05:23 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-30 15:08:18 +1000
commit16315a3170ec018a834e68360e06b506415446d2 (patch)
tree90cfe456040fce35b904e88462886e3c73a2f3f2 /cdn/tests/filestorage.test.js
parentStart listening after database and config has been loaded (diff)
parentOop, deprecated typeorm call (diff)
downloadserver-16315a3170ec018a834e68360e06b506415446d2.tar.xz
Merge branch 'staging' into dev/Maddy/fix/listeningAfterDb
Diffstat (limited to 'cdn/tests/filestorage.test.js')
-rw-r--r--cdn/tests/filestorage.test.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/cdn/tests/filestorage.test.js b/cdn/tests/filestorage.test.js
deleted file mode 100644

index 78036602..00000000 --- a/cdn/tests/filestorage.test.js +++ /dev/null
@@ -1,27 +0,0 @@ -const path = require("path"); -process.env.STORAGE_LOCATION = path.join(__dirname, "..", "files", "/"); - -const { FileStorage } = require("../dist/util/FileStorage"); -const storage = new FileStorage(); -const fs = require("fs"); - -const file = fs.readFileSync(path.join(__dirname, "antman.jpg")); - -describe("FileStorage", () => { - describe("saving a file", () => { - test("saving a buffer", async () => { - await storage.set("test_saving_file", file); - }); - }); - describe("getting a file", () => { - test("getting buffer with given name", async () => { - const buffer2 = await storage.get("test_saving_file"); - expect(Buffer.compare(file, buffer2)).toBeTruthy(); - }); - }); - describe("deleting a file", () => { - test("deleting buffer with given name", async () => { - await storage.delete("test_saving_file"); - }); - }); -});