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

Function test

types/test/usage.ts:3–32  ·  types/test/usage.ts::test
()

Source from the content-addressed store, hash-verified

1import { Group, User } from class="st">'./models/User';
2
3async function test(): Promise<void> {
4 let user = await User.findOne({ include: [Group] });
5 if (!user) {
6 return;
7 }
8 User.update({}, { where: {} });
9 user.firstName = class="st">'John';
10 await user.save();
11 await user.setGroup(2);
12
13 user = new User();
14 user = new User({ firstName: class="st">'John' });
15
16 user = await User.findOne();
17
18 if (!user) {
19 return;
20 }
21
22 user.update({}, {});
23 user.update({}, {
24 silent: true
25 });
26
27 const user2 = await User.create({ firstName: class="st">'John', groupId: 1 });
28 await User.findAndCountAll({ distinct: true });
29
30 const user3 = await User.create({ firstName: class="st">'Jane', groupId: 1 }, { validate: false });
31 await User.findAndCountAll({ distinct: true });
32}

Callers

nothing calls this directly

Calls 5

findOneMethod · 0.80
saveMethod · 0.80
findAndCountAllMethod · 0.80
updateMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected