You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe('BillingService',()=>{letservice: BillingService;beforeEach(async()=>{constmodule: TestingModule=awaitTest.createTestingModule({imports: [SessionModule,TypeOrmModule.forRoot(testConfig),TypeOrmModule.forFeature([Bill]),],providers: [BillingService],}).overrideProvider(TwilioService).useValue({}).compile();constapp=module.createNestApplication();awaitapp.init();service=module.get<BillingService>(BillingService);constloader=newLoader();loader.load(__dirname+'/fixtures');constresolver=newResolver();constfixtures=resolver.resolve(loader.fixtureConfigs);constconnection: Connection=module.get(Connection);constbuilder=newBuilder(connection,newParser());for(constfixtureoffixturesIterator(fixtures)){constentity=awaitbuilder.build(fixture);console.log(entity);awaitgetRepository(entity.constructor.name).save(entity);}});it('should be defined',()=>{expect(service).toBeDefined();});});
the console.log() always prints Customer {}, which is the correct type of entity, but empty, meaning it does not contain any of the fields mentioned in the fixture yaml, which again crashes the save call, because the database restrictions are not fullfilled.
Any suggestions what I can try to make it work?
The text was updated successfully, but these errors were encountered:
Your Environment
Hi there, thanks for this project.
I am currently trying to integrate it in the tests of my nest project, but cant get it to work properly.
When I try to get these fixtures
persisted to my test database with this code:
the
console.log()
always printsCustomer {}
, which is the correct type of entity, but empty, meaning it does not contain any of the fields mentioned in the fixture yaml, which again crashes thesave
call, because the database restrictions are not fullfilled.Any suggestions what I can try to make it work?
The text was updated successfully, but these errors were encountered: