This commit is contained in:
parent
ca556349a8
commit
96769d9ff9
|
@ -52,6 +52,15 @@ async function test() {
|
|||
await backendStatus();
|
||||
|
||||
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
|
||||
const myReporter = {
|
||||
specDone: function(result) {
|
||||
for (const expectation of result.failedExpectations) {
|
||||
console.warn('SpecFailed: ' + result.description);
|
||||
console.warn('Failure: ' + expectation.message);
|
||||
}
|
||||
}
|
||||
};
|
||||
jasmine.addReporter(myReporter);
|
||||
await jasmine.execute();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ describe('Supplier newSupplier()', () => {
|
|||
const result = await models.Supplier.newSupplier(ctx, options);
|
||||
|
||||
expect(result.name).toEqual('newSupplier');
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
|
|
|
@ -129,10 +129,10 @@ describe('loopback model Supplier', () => {
|
|||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const newSupplier = await models.Supplier.create({id: '9999', name: 'Alfred Pennyworth'}, options);
|
||||
const newSupplier = await models.Supplier.create({name: 'Alfred Pennyworth'}, options);
|
||||
const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options);
|
||||
|
||||
expect(fetchedSupplier.account).toEqual('4100009999');
|
||||
expect(Number(fetchedSupplier.account)).toEqual(4100000000 + newSupplier.id);
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
|
|
Loading…
Reference in New Issue