How to use the loopback-datasource-juggler.Transaction function in loopback-datasource-juggler

To help you get started, we’ve selected a few loopback-datasource-juggler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / loopback-next / packages / repository / src / __tests__ / unit / repositories / legacy-juggler-bridge.unit.ts View on Github external
it('calls connector beginTransaction() when available', async () => {
    const crudDs = new juggler.DataSource({
      name: 'db',
      connector: CrudConnectorStub,
    });

    const repo = new DefaultTransactionalRepository(Note, crudDs);
    const res = await repo.beginTransaction();
    expect(res).to.be.instanceOf(TransactionClass);
  });
});