MCPcopy
hub / github.com/sequelize/sequelize / test

Function test

types/test/define.ts:29–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27);
28
29async function test() {
30 expectTypeOf<UserModel>().toMatchTypeOf(User.build());
31
32 const user = await User.findOne();
33 expectTypeOf(user).toEqualTypeOf<UserModel | null>();
34
35 if (!user) return;
36 user.firstName = 'John';
37 await user.save();
38}
39
40// The below doesn't define Attribute types, but should still work
41interface UntypedUserModel extends Model, UserAttributes {}

Callers

nothing calls this directly

Calls 3

buildMethod · 0.80
findOneMethod · 0.80
saveMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…