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

safe-global / safe-client-gateway / 11462535097

22 Oct 2024 02:36PM UTC coverage: 90.264% (-1.4%) from 91.686%
11462535097

push

github

web-flow
Orm (#1942)

* Add TypeOrm support.
* Introduce a new query logger to TypeORM.
* Ensure TypeORM migrations run after locking the database during startup.
* Establish database connection only when the database module is registered.

2666 of 3269 branches covered (81.55%)

Branch coverage included in aggregate %.

133 of 275 new or added lines in 39 files covered. (48.36%)

1 existing line in 1 file now uncovered.

8849 of 9488 relevant lines covered (93.27%)

422.0 hits per line

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

75.0
/src/datasources/db/v2/test.postgres-database.module.ts
1
import { Module } from '@nestjs/common';
102✔
2
import { PostgresDatabaseService } from '@/datasources/db/v2/postgres-database.service';
102✔
3
import type { DataSource } from 'typeorm';
4

5
export const postgresDataSourceMock = {
102✔
6
  query: jest.fn(),
7
  runMigrations: jest.fn(),
8
  initialize: jest.fn(),
9
} as jest.MockedObjectDeep<DataSource>;
10

11
export const postgresDatabaseServiceMock = {
102✔
NEW
12
  getDataSource: jest.fn().mockImplementation(() => postgresDataSourceMock),
×
13
  isInitialized: jest.fn(),
14
  initializeDatabaseConnection: jest
15
    .fn()
NEW
16
    .mockImplementation(() => postgresDataSourceMock),
×
17
  destroyDatabaseConnection: jest.fn(),
18
  getRepository: jest.fn(),
19
  transaction: jest.fn(),
20
  getTransactionRunner: jest.fn(),
21
} as jest.MockedObjectDeep<PostgresDatabaseService>;
22

23
@Module({
24
  providers: [
25
    {
26
      provide: PostgresDatabaseService,
27
      useFactory: (): jest.MockedObjectDeep<PostgresDatabaseService> => {
28
        return jest.mocked(postgresDatabaseServiceMock);
2✔
29
      },
30
    },
31
  ],
32
  exports: [PostgresDatabaseService],
33
})
34
export class TestPostgresDatabaseModuleV2 {}
102✔
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