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

safe-global / safe-client-gateway-nest / 5356629757

Canceled at 31 May 2024 04:53AM UTC via web
5356629757

push

github

hectorgomezv
Move its logic to a separated MultisigTransactionExecutionDetailsMapper

848 of 1029 branches covered (82.41%)

Branch coverage included in aggregate %.

4167 of 4412 relevant lines covered (94.45%)

51.5 hits per line

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

0.0
/src/routes/contracts/__tests__/get-contract.e2e-spec.ts
1
import * as request from 'supertest';
×
2
import { RedisClientType } from 'redis';
3
import { INestApplication } from '@nestjs/common';
4
import { Test } from '@nestjs/testing';
×
5
import { AppModule } from '../../../app.module';
×
6
import { readFileSync } from 'fs';
×
7
import { Contract } from '../entities/contract.entity';
8
import { redisClientFactory } from '../../../__tests__/redis-client.factory';
×
9
import { TestAppProvider } from '../../../app.provider';
×
10

11
describe('Get contract e2e test', () => {
×
12
  let app: INestApplication;
13
  let redisClient: RedisClientType;
14
  const chainId = '5'; // Görli testnet
×
15

16
  beforeAll(async () => {
×
17
    const moduleRef = await Test.createTestingModule({
×
18
      imports: [AppModule],
19
    }).compile();
20

21
    app = await new TestAppProvider().provide(moduleRef);
×
22
    await app.init();
×
23
    redisClient = await redisClientFactory();
×
24
  });
25

26
  beforeEach(async () => {
×
27
    await redisClient.flushAll();
×
28
  });
29

30
  it('GET /contracts/<address>', async () => {
×
31
    const contractAddress = '0x7cbB62EaA69F79e6873cD1ecB2392971036cFAa4';
×
32
    const expectedResponse: Contract = JSON.parse(
×
33
      readFileSync(
34
        'src/routes/contracts/__tests__/resources/contract-expected-response.json',
35
        {
36
          encoding: 'utf-8',
37
        },
38
      ),
39
    );
40

41
    await request(app.getHttpServer())
×
42
      .get(`/v1/chains/${chainId}/contracts/${contractAddress}`)
43
      .expect(200)
44
      .then(({ body }) => {
45
        expect(body).toEqual(expectedResponse);
×
46
      });
47

48
    const cacheContent = await redisClient.hGet(
×
49
      `${chainId}_contract_${contractAddress}`,
50
      '',
51
    );
52
    expect(cacheContent).toEqual(JSON.stringify(expectedResponse));
×
53
  });
54

55
  afterAll(async () => {
×
56
    await app.close();
×
57
    await redisClient.flushAll();
×
58
    await redisClient.quit();
×
59
  });
60
});
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