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.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/util/tests/validate.test.js b/util/tests/validate.test.js
index c885a167..434422f8 100644
--- a/util/tests/validate.test.js
+++ b/util/tests/validate.test.js
@@ -1,4 +1,4 @@
-const { initDatabase } = require("../dist/util/Database");
+const { initDatabase, closeDatabase } = require("../dist/util/Database");
 const { User } = require("../dist/entities/User");
 jest.setTimeout(10000);
 
@@ -9,13 +9,15 @@ beforeAll((done) => {
 	});
 });
 
+afterAll(() => {
+	closeDatabase();
+});
+
 describe("Validate model class properties", () => {
-	describe("User", () => {
-		test("object instead of string", async () => {
-			expect(() => {
-				new User({ username: {} }).validate();
-			}).toThrow();
-		});
+	test("object instead of string", async () => {
+		expect(() => {
+			new User({}, { id: {} }).validate();
+		}).toThrow();
 	});
 
 	test("validation should be faster than 20ms", () => {