From 766dcc24aa1f1de60cc15af699f933d521aa85b6 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 29 Aug 2021 00:03:58 +0200 Subject: :sparkles: update util --- util/tests/validate.test.js | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 util/tests/validate.test.js (limited to 'util/tests/validate.test.js') diff --git a/util/tests/validate.test.js b/util/tests/validate.test.js deleted file mode 100644 index 434422f8..00000000 --- a/util/tests/validate.test.js +++ /dev/null @@ -1,33 +0,0 @@ -const { initDatabase, closeDatabase } = require("../dist/util/Database"); -const { User } = require("../dist/entities/User"); -jest.setTimeout(10000); - -beforeAll((done) => { - initDatabase().then(() => { - new User().validate(); // warm up schema/model - done(); - }); -}); - -afterAll(() => { - closeDatabase(); -}); - -describe("Validate model class properties", () => { - test("object instead of string", async () => { - expect(() => { - new User({}, { id: {} }).validate(); - }).toThrow(); - }); - - test("validation should be faster than 20ms", () => { - expect(() => { - new User().validate(); - }).toBeFasterThan(20); - }); - - test("should not set opts", () => { - const user = new User({ opts: { id: 0 } }); - expect(user.opts.id).not.toBe(0); - }); -}); -- cgit 1.5.1