UNPKG

typeorm-test-transactions

Version:

A transactional wrapper for tests that use TypeORM that automatically rolls back the transaction at the end of the test.

24 lines (21 loc) 377 B
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn, Unique, } from 'typeorm'; @Entity('users') @Unique(['email']) export class User extends BaseEntity { @PrimaryGeneratedColumn({ name: 'user_id', }) userId: number; @Column({ type: 'varchar', name: 'email', length: 128, }) email: string; }