test: student repository is getest
This commit is contained in:
parent
3cd7496989
commit
5502c6c58e
5 changed files with 2520 additions and 393 deletions
|
@ -1,7 +1,16 @@
|
|||
import { initORM } from '../src/orm.js';
|
||||
import { Student } from '../src/entities/users/student.entity.js';
|
||||
import { forkEntityManager, initORM } from '../src/orm.js';
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
export async function setupTestApp() {
|
||||
dotenv.config({ path: '.env.test' });
|
||||
await initORM(true);
|
||||
|
||||
const em = forkEntityManager();
|
||||
|
||||
const user01 = em.create(Student, {username: 'Noordkaap', firstName: 'Stijn', lastName: 'Meuris'})
|
||||
const user02 = em.create(Student, {username: 'DireStraits', firstName: 'Mark', lastName: 'Knopfler'})
|
||||
const user03 = em.create(Student, {username: 'SmashingPumpkins', firstName: 'Billy', lastName: 'Corgan'})
|
||||
|
||||
await em.persistAndFlush([user01, user02, user03]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue