undeexcepturi
Version:
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.
54 lines (36 loc) • 930 B
text/typescript
import { Embeddable, Embedded, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/sqlite';
class D {
test?: boolean = false;
}
class C {
d!: D;
}
class B {
c!: C;
c2!: C;
}
class A {
id!: number;
b: B[] = [];
}
describe('GH issue 1616', () => {
test('order of embeddables during discovery should not matter', async () => {
const orm = await MikroORM.init({
entities: [C, D, A, B],
dbName: ':memory:',
});
const schema = await orm.schema.getCreateSchemaSQL({ wrap: false });
expect(schema).toMatchSnapshot();
await orm.close();
});
});