diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-18 16:15:48 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-18 16:15:48 +0200 |
commit | 88b51706ca8bda9733c28503848eae71039380de (patch) | |
tree | 7b5ae202c16a18fc967cd0fd3ee135bd6325c46c /cdn/tests/start.test.js | |
parent | revert 2cff55f (diff) | |
parent | Merge branch 'master' of git://github.com/fosscord/fosscord-server (diff) | |
download | server-88b51706ca8bda9733c28503848eae71039380de.tar.xz |
Merge branches 'master' and 'master' of https://github.com/fosscord/fosscord-server
Diffstat (limited to 'cdn/tests/start.test.js')
-rw-r--r-- | cdn/tests/start.test.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cdn/tests/start.test.js b/cdn/tests/start.test.js new file mode 100644 index 00000000..348405de --- /dev/null +++ b/cdn/tests/start.test.js @@ -0,0 +1,22 @@ +const { CDNServer } = require("../dist/Server"); +const { db } = require("@fosscord/util"); +const supertest = require("supertest"); +const request = supertest("http://localhost:3003"); +const server = new CDNServer({ port: Number(process.env.PORT) || 3003 }); + +beforeAll(async () => { + await server.start(); + db.close(); + return server; +}); + +afterAll(() => { + return server.stop(); +}); + +describe("GET /ping", () => { + test("should return pong", async () => { + const response = await request.get("/ping"); + expect(response.text).toBe("pong"); + }); +}); |