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.
34 lines (23 loc) • 745 B
text/typescript
import { Embedded, Entity, MikroORM, PrimaryKey, Property } from '@mikro-orm/core';
import { SqliteDriver } from '@mikro-orm/sqlite';
export class Options {
loop!: string;
}
export class PlayerEntity {
id!: number;
options = new Options();
}
describe('validating not discovered emebddables', () => {
test(`GH issue 2357`, async () => {
await expect(MikroORM.init({
entities: [PlayerEntity],
dbName: ':memory:',
driver: SqliteDriver,
connect: false,
})).rejects.toThrow(`Entity 'Options' was not discovered, please make sure to provide it in 'entities' array when initializing the ORM (used in PlayerEntity.options)`);
});
});