summary refs log tree commit diff
path: root/util/tests/validate.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'util/tests/validate.test.js')
-rw-r--r--util/tests/validate.test.js33
1 files changed, 0 insertions, 33 deletions
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); - }); -});