Skip to content
Snippets Groups Projects

test(ssi): added integration and unit tests

Merged Berend Sliedrecht requested to merge unit-tests-ssi-abstraction into main
All threads resolved!
Files
15
import { Test } from '@nestjs/testing';
import { mockConfigModule } from '../../config/__tests__/mockConfig.js';
import { AgentController } from '../agent.controller.js';
import { AgentService } from '../agent.service.js';
describe('AgentController', () => {
let agentController: AgentController;
let agentService: AgentService;
beforeEach(async () => {
const moduleRef = await Test.createTestingModule({
imports: [mockConfigModule],
controllers: [AgentController],
providers: [AgentService],
}).compile();
agentService = moduleRef.get(AgentService);
agentController = moduleRef.get(AgentController);
});
describe('public did', () => {
it('should get the public did information of the agent', async () => {
const result = { id: 'test' };
jest
.spyOn(agentService, 'getPublicDid')
.mockImplementation(() => Promise.resolve(result));
expect(await agentController.publicDid()).toBe(result);
});
});
});
Loading