This commit is contained in:
parent
ca556349a8
commit
96769d9ff9
|
@ -52,6 +52,15 @@ async function test() {
|
||||||
await backendStatus();
|
await backendStatus();
|
||||||
|
|
||||||
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
|
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();
|
await jasmine.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ describe('Supplier newSupplier()', () => {
|
||||||
const result = await models.Supplier.newSupplier(ctx, options);
|
const result = await models.Supplier.newSupplier(ctx, options);
|
||||||
|
|
||||||
expect(result.name).toEqual('newSupplier');
|
expect(result.name).toEqual('newSupplier');
|
||||||
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
throw e;
|
throw e;
|
||||||
|
|
|
@ -129,10 +129,10 @@ describe('loopback model Supplier', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
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);
|
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();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
Loading…
Reference in New Issue