• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-client-gateway / 16221736765

11 Jul 2025 01:52PM UTC coverage: 89.51% (-0.2%) from 89.688%
16221736765

Pull #2625

github

LucieFaire
add tests for event handlers

Signed-off-by: dsh <11198975+LucieFaire@users.noreply.github.com>
Pull Request #2625: feat: Add BullMQ job queue system

3466 of 4236 branches covered (81.82%)

Branch coverage included in aggregate %.

35 of 74 new or added lines in 11 files covered. (47.3%)

20 existing lines in 6 files now uncovered.

12004 of 13047 relevant lines covered (92.01%)

545.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/modules/csv-export/csv-export.consumer.ts
NEW
1
import { CSV_EXPORT_QUEUE } from '@/domain/common/entities/jobs.constants';
×
NEW
2
import { ILoggingService, LoggingService } from '@/logging/logging.interface';
×
3
import { CsvExportJobData } from '@/modules/csv-export/entities/csv-export-job-data.entity';
NEW
4
import { OnWorkerEvent, Processor, WorkerHost } from '@nestjs/bullmq';
×
NEW
5
import { Inject } from '@nestjs/common';
×
NEW
6
import { Job } from 'bullmq';
×
7

8
@Processor(CSV_EXPORT_QUEUE)
NEW
9
export class CsvExportConsumer extends WorkerHost {
×
10
  constructor(
NEW
11
    @Inject(LoggingService) private readonly loggingService: ILoggingService,
×
12
  ) {
NEW
13
    super();
×
14
  }
15

16
  process(job: Job<CsvExportJobData>): Promise<void> {
NEW
17
    throw new Error(`Job ${job.name} is not implemented yet.`);
×
18
  }
19

20
  @OnWorkerEvent('completed')
NEW
21
  onCompleted(job: Job, result: unknown): void {
×
NEW
22
    this.loggingService.info(`Job ${job.id} completed; returned ${result}`);
×
23
  }
24

25
  // Fired when a job fails (after all retries)
26
  @OnWorkerEvent('failed')
NEW
27
  onFailed(job: Job, error: Error): void {
×
NEW
28
    this.loggingService.error(`Job ${job.id} failed: ${error}`);
×
29
  }
30

31
  // Fired whenever `process()` calls job.updateProgress()
32
  @OnWorkerEvent('progress')
NEW
33
  onProgress(job: Job, progress: number): void {
×
NEW
34
    this.loggingService.info(`Job ${job.id} progress: ${progress}%`);
×
35
  }
36

37
  @OnWorkerEvent('error')
NEW
38
  onWorkerError(error: Error): void {
×
NEW
39
    this.loggingService.error(
×
40
      `Worker of ${CSV_EXPORT_QUEUE} queue encountered an error: ${error}`,
41
    );
42
  }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc