MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / createEntities

Function createEntities

tests/features/auto-refreshing.postgre.test.ts:18–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 });
17
18 async function createEntities() {
19 const god = new Author2('God', 'hello@heaven.god');
20 god.favouriteAuthor = new Author2('God 2', 'hello2@heaven.god');
21 god.favouriteAuthor.age = 21;
22 god.age = 999;
23 god.identities = ['a', 'b', 'c'];
24 const b1 = new Book2('Bible 1', god);
25 b1.perex = ref('b1 perex');
26 b1.price = 123;
27 const b2 = new Book2('Bible 2', god);
28 b2.perex = ref('b2 perex');
29 b2.price = 456;
30 const b3 = new Book2('Bible 3', god);
31 b3.perex = ref('b3 perex');
32 b3.price = 789;
33 await orm.em.fork().persist([b1, b2, b3]).flush();
34
35 return { god };
36 }
37
38 test('em.find()', async () => {
39 const { god } = await createEntities();

Callers 1

Calls 4

refFunction · 0.90
forkMethod · 0.80
persistMethod · 0.65
flushMethod · 0.45

Tested by

no test coverage detected