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

safe-global / safe-client-gateway / 9546514333

17 Jun 2024 11:01AM UTC coverage: 49.473% (-42.8%) from 92.296%
9546514333

push

github

web-flow
Add `PostgresDatabaseMigrator` for (testing) migration (#1655)

Adds a new `PostgresDatabaseMigrator` that has the core logic of `postgres-shift`, as well as a testing method. The `migrate` method mirrors `postgres-shift` and the `test` method reuses part of it, executing each migration in a separate transaction. It allows us to interact with the database _before_ and _after_ a migration has executed, stopping after the desired migration:

- Create `PostgresDatabaseMigrator` and inject it
- Remove `postgres-shift` and associated definition/patch, replacing usage with the above
- Add appropriate test coverage

394 of 2367 branches covered (16.65%)

Branch coverage included in aggregate %.

10 of 62 new or added lines in 3 files covered. (16.13%)

2191 existing lines in 221 files now uncovered.

3969 of 6452 relevant lines covered (61.52%)

12.49 hits per line

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

30.43
/src/logging/__tests__/test.logging.module.ts
1
import { Global, Inject, Module } from '@nestjs/common';
2✔
2
import { IConfigurationService } from '@/config/configuration.service.interface';
2✔
3
import { ILoggingService, LoggingService } from '@/logging/logging.interface';
2✔
4

5
class TestLoggingService implements ILoggingService {
2✔
6
  private readonly isSilent: boolean;
7

8
  constructor(
9
    @Inject(IConfigurationService)
10
    private readonly configurationService: IConfigurationService,
2✔
11
  ) {
12
    this.isSilent = configurationService.getOrThrow<boolean>('log.silent');
2✔
13
  }
14

15
  debug(message: unknown): void {
UNCOV
16
    if (this.isSilent) return;
×
17
    console.debug(message);
×
18
  }
19

20
  error(message: unknown): void {
UNCOV
21
    if (this.isSilent) return;
×
22
    console.error(message);
×
23
  }
24

25
  info(message: unknown): void {
UNCOV
26
    if (this.isSilent) return;
×
27
    console.info(message);
×
28
  }
29

30
  warn(message: unknown): void {
UNCOV
31
    if (this.isSilent) return;
×
32
    console.warn(message);
×
33
  }
34
}
35

36
@Global()
37
@Module({
38
  providers: [{ provide: LoggingService, useClass: TestLoggingService }],
39
  exports: [LoggingService],
40
})
41
export class TestLoggingModule {}
2✔
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