refs #6915 test_master24_8 #2067

Merged
alexm merged 561 commits from test_master24_8 into master 2024-02-22 07:31:34 +00:00
4 changed files with 8 additions and 14 deletions
Showing only changes of commit 2cab007f57 - Show all commits

View File

@ -96,6 +96,7 @@ async function test() {
// runner.loadConfigFile('back/jasmine.json');
runner.loadConfig(config);
process.env.SPEC_IS_RUNNING = true;
await runner.execute();
}

View File

@ -1,10 +1,6 @@
const models = require('vn-loopback/server/server').models;
describe('route downloadCmrsZip()', () => {
beforeEach(() => {
spyOn(models.Route, 'downloadCmrsZip').and.returnValue(true);
});
it('should create a zip file with the given cmr ids', async() => {
const tx = await models.Route.beginTransaction({});
const ctx = {
@ -19,7 +15,7 @@ describe('route downloadCmrsZip()', () => {
try {
const stream = await models.Route.downloadCmrsZip(ctx, cmrs);
expect(stream).toBeTrue();
expect(stream[0]).toBeDefined();
await tx.rollback();
} catch (e) {
await tx.rollback();

View File

@ -1,10 +1,6 @@
const models = require('vn-loopback/server/server').models;
describe('ticket saveCmr()', () => {
beforeEach(() => {
spyOn(models.Ticket, 'saveCmr').and.returnValue(true);
});
it(`should throw error if the cmr can't save`, async() => {
const tx = await models.Ticket.beginTransaction({});
const ctx = {
@ -18,11 +14,11 @@ describe('ticket saveCmr()', () => {
};
try {
const options = {transaction: tx};
const ticket = [1];
await models.Ticket.saveCmr(ctx, ticket);
const ticket = [2];
await models.Ticket.saveCmr(ctx, ticket, options);
const hasDmsCmr = await models.TicketDms.findOne({
where: {ticketFk: ticket[1]},
where: {ticketFk: ticket[0]},
include: [{
relation: 'dms',
fields: ['id'],
@ -35,7 +31,7 @@ describe('ticket saveCmr()', () => {
}]
}, options);
expect(hasDmsCmr?.dms()?.dmsType()).toEqual(1);
expect(hasDmsCmr?.dms()?.id).toBeGreaterThanOrEqual(1);
await tx.rollback();
} catch (e) {
await tx.rollback();

View File

@ -35,7 +35,8 @@ module.exports = {
logger.error(`[Print] => ${err.message}`);
});
cluster.on('queue', () => logger.info('Printing task initialized by pool'));
cluster.on('queue', () =>
process.env.SPEC_IS_RUNNING === 'false' && logger.info('Printing task initialized by pool'));
});
}
};