diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-09-25 18:24:21 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-09-25 23:35:18 +1000 |
commit | 0d23eaba09a4878520bf346af4cead90d76829fc (patch) | |
tree | d930eacceff0b407b44abe55f01d8e3c5dfbfa34 /util/tests/User.test.js | |
parent | Allow edited_timestamp to passthrough in handleMessage (diff) | |
download | server-0d23eaba09a4878520bf346af4cead90d76829fc.tar.xz |
Refactor to mono-repo + upgrade packages
Diffstat (limited to 'util/tests/User.test.js')
-rw-r--r-- | util/tests/User.test.js | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/util/tests/User.test.js b/util/tests/User.test.js deleted file mode 100644 index c0852ebc..00000000 --- a/util/tests/User.test.js +++ /dev/null @@ -1,43 +0,0 @@ -const { initDatabase, closeDatabase } = require("../dist/util/Database"); -const { User } = require("../dist/entities/User"); -jest.setTimeout(20000); - -beforeAll((done) => { - initDatabase().then(() => { - done(); - }); -}); - -afterAll(() => { - closeDatabase(); -}); - -describe("User", () => { - test("valid discriminator: 1", async () => { - new User({ discriminator: "1" }).validate(); - }); - test("invalid discriminator: test", async () => { - expect(() => { - new User({ discriminator: "test" }).validate(); - }).toThrow(); - }); - - test("invalid discriminator: 0", async () => { - expect(() => { - new User({ discriminator: "0" }).validate(); - }).toThrow(); - }); - - test("add guild", async () => { - try { - await new User({ guilds: [], discriminator: "1" }, { id: "0" }).save(); - const user = await User.find("0"); - - user.guilds.push(new Guild({ name: "test" })); - - user.save(); - } catch (error) { - console.error(error); - } - }); -}); |