Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
nats.spec.ts 1.16 KiB
// import { ClientProxy } from '@nestjs/microservices';
import NatsClientService from './nats.client';

describe('Check if the nats client is working', () => {
  //   let natsClient: NatsClientService;
  //   let client: ClientProxy;

  //   beforeEach(() => {
  //     natsClient = new NatsClientService(client);
  //   });

  //   jest.mock('rxjs', () => {
  //     const original = jest.requireActual('rxjs');

  //     return {
  //       ...original,
  //       lastValueFrom: () => new Promise((resolve, reject) => {
  //         resolve(true);
  //       }),
  //     };
  //   });

  it('should be defined', () => {
    expect(NatsClientService).toBeDefined();
  });

  // it('should call the offer membership credential endpoint', async () => {
  //     const data = {
  //         status: 'complete',
  //         connectionId: 'connectionId',
  //         theirLabel: 'theirLabel',
  //         participantId: 'participantId',
  //         participantDID: 'participantDID'
  //     };
  //     jest.spyOn(client, 'send').mockReturnValue(of(data));
  //     const response = await natsClient.OfferMembershipCredential(data);
  //     expect(response).toBeTruthy();
  // });
});