diff options
Diffstat (limited to 'util/tests/User.test.js')
-rw-r--r-- | util/tests/User.test.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/util/tests/User.test.js b/util/tests/User.test.js index b87c753d..c0852ebc 100644 --- a/util/tests/User.test.js +++ b/util/tests/User.test.js @@ -1,10 +1,9 @@ const { initDatabase, closeDatabase } = require("../dist/util/Database"); const { User } = require("../dist/entities/User"); -jest.setTimeout(10000); +jest.setTimeout(20000); beforeAll((done) => { initDatabase().then(() => { - new User().validate(); // warm up schema/model done(); }); }); @@ -28,4 +27,17 @@ describe("User", () => { 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); + } + }); }); |