blob: d36da1ed6af3c98dc6f8a854bb2fd30569e4be3a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
const { initDatabase } = require("../dist/util/Database");
const { User } = require("../dist/entities/User");
beforeAll(async () => {
await initDatabase();
new User().validate();
});
describe("Validate model class properties", () => {
describe("validation should be faster than 20ms", () => {
expect(() => new User().validate()).toBeFasterThan(20);
});
describe("User", () => {
test("object instead of string", () => {
expect(() => {
new User({ username: {} }).validate();
}).toThrow();
});
});
test("should not set opts", () => {
const user = new User({ opts: { id: 0 } });
expect(user.opts.id).not.toBe(0);
});
test("test", () => {
expect(1).toBe(1);
});
});
|