20 lines
609 B
JavaScript
20 lines
609 B
JavaScript
const {models} = require('vn-loopback/server/server');
|
|
|
|
describe('Supplier getWithPackaging()', () => {
|
|
beforeAll.mockLoopBackContext();
|
|
it('should return a list of suppliers with an entry of type packaging', async() => {
|
|
const tx = await models.Supplier.beginTransaction({});
|
|
const myOptions = {transaction: tx};
|
|
|
|
try {
|
|
const result = await models.Supplier.getWithPackaging(myOptions);
|
|
|
|
expect(result.length).toEqual(1);
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
throw e;
|
|
}
|
|
});
|
|
});
|