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

safe-global / safe-client-gateway-nest / 6012558909

29 Aug 2023 12:55PM UTC coverage: 92.487%. Remained the same
6012558909

Pull #633

github

usame-algan
refactor: Use path alias instead of relative imports
Pull Request #633: refactor: Use path alias instead of relative imports

975 of 1164 branches covered (0.0%)

Branch coverage included in aggregate %.

361 of 375 new or added lines in 179 files covered. (96.27%)

13 existing lines in 7 files now uncovered.

4515 of 4772 relevant lines covered (94.61%)

73.56 hits per line

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

93.33
/src/datasources/cache/cache.module.ts
1
import { Global, Module } from '@nestjs/common';
26✔
2
import { CacheService } from './cache.service.interface';
26✔
3
import { RedisCacheService } from './redis.cache.service';
26✔
4
import { createClient } from 'redis';
26✔
5
import { IConfigurationService } from '@/config/configuration.service.interface';
26✔
6
import {
26✔
7
  ILoggingService,
8
  LoggingService,
9
} from '@/logging/logging.interface';
10
import { CacheReadiness } from '@domain/interfaces/cache-readiness.interface';
26✔
11

12
export type RedisClientType = ReturnType<typeof createClient>;
13

14
async function redisClientFactory(
15
  configurationService: IConfigurationService,
16
  loggingService: ILoggingService,
17
): Promise<RedisClientType> {
18
  const redisHost = configurationService.getOrThrow<string>('redis.host');
7✔
19
  const redisPort = configurationService.getOrThrow<string>('redis.port');
7✔
20
  const client: RedisClientType = createClient({
7✔
21
    url: `redis://${redisHost}:${redisPort}`,
22
  });
23
  client.on('error', (err) =>
7✔
UNCOV
24
    loggingService.error(`Redis client error: ${err}`),
×
25
  );
26
  client.connect();
7✔
27
  return client;
7✔
28
}
29

30
@Global()
31
@Module({
32
  providers: [
33
    {
34
      provide: 'RedisClient',
35
      useFactory: redisClientFactory,
36
      inject: [IConfigurationService, LoggingService],
37
    },
38
    { provide: CacheService, useClass: RedisCacheService },
39
    { provide: CacheReadiness, useExisting: CacheService },
40
  ],
41
  exports: [CacheService, CacheReadiness],
42
})
43
export class CacheModule {}
26✔
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

© 2025 Coveralls, Inc