()
| 44 | } |
| 45 | |
| 46 | async function createEntities() { |
| 47 | const em = orm.em.fork(); |
| 48 | |
| 49 | for (let i = 0; i < 10; i++) { |
| 50 | const className = new ClassName(); |
| 51 | className.foo = `CLSS${i}`; |
| 52 | |
| 53 | em.persist(className); |
| 54 | } |
| 55 | |
| 56 | await em.flush(); |
| 57 | |
| 58 | for (let i = 0; i < 50; i++) { |
| 59 | const product = new Product(); |
| 60 | |
| 61 | em.assign(product, { |
| 62 | className: getRandomBetween1And10(), |
| 63 | }); |
| 64 | |
| 65 | const subProduct = new SubProduct(); |
| 66 | |
| 67 | em.assign(subProduct, { |
| 68 | product, |
| 69 | }); |
| 70 | |
| 71 | em.persist(product); |
| 72 | em.persist(subProduct); |
| 73 | } |
| 74 | |
| 75 | await em.flush(); |
| 76 | } |
| 77 | |
| 78 | let orm: MikroORM; |
| 79 |
no test coverage detected