Skip to content

Commit

Permalink
DPP-1 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Brummos committed Aug 1, 2023
1 parent 728be58 commit 203d050
Show file tree
Hide file tree
Showing 22 changed files with 706 additions and 246 deletions.
6 changes: 3 additions & 3 deletions packages/contact-manager/__tests__/localAgent.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createObjects, getConfig } from '../../agent-config/dist'
import { Connection } from 'typeorm'
import { DataSource } from 'typeorm'

jest.setTimeout(30000)

import contactManagerAgentLogic from './shared/contactManagerAgentLogic'

let dbConnection: Promise<Connection>
let dbConnection: Promise<DataSource>
let agent: any

const setup = async (): Promise<boolean> => {
Expand All @@ -29,6 +29,6 @@ const testContext = {
tearDown,
}

describe('Local integration tests', () => {
describe('Local integration tests', (): void => {
contactManagerAgentLogic(testContext)
})
14 changes: 7 additions & 7 deletions packages/contact-manager/__tests__/restAgent.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'cross-fetch/polyfill'
// @ts-ignore
import express from 'express'
import express, { Router } from 'express'
import { Server } from 'http'
import { Connection } from 'typeorm'
import { DataSource } from 'typeorm'
import { IAgent, createAgent, IAgentOptions } from '@veramo/core'
import { AgentRestClient } from '@veramo/remote-client'
import { AgentRouter, RequestWithAgentRouter } from '@veramo/remote-server'
Expand All @@ -17,7 +17,7 @@ const basePath = '/agent'

let serverAgent: IAgent
let restServer: Server
let dbConnection: Promise<Connection>
let dbConnection: Promise<DataSource>

const getAgent = (options?: IAgentOptions) =>
createAgent<IContactManager>({
Expand All @@ -41,14 +41,14 @@ const setup = async (): Promise<boolean> => {
exposedMethods: serverAgent.availableMethods(),
})

const requestWithAgent = RequestWithAgentRouter({
const requestWithAgent: Router = RequestWithAgentRouter({
agent: serverAgent,
})

return new Promise((resolve) => {
return new Promise((resolve): void => {
const app = express()
app.use(basePath, requestWithAgent, agentRouter)
restServer = app.listen(port, () => {
restServer = app.listen(port, (): void => {
resolve(true)
})
})
Expand All @@ -66,6 +66,6 @@ const testContext = {
tearDown,
}

describe('REST integration tests', () => {
describe('REST integration tests', (): void => {
contactManagerAgentLogic(testContext)
})
Loading

0 comments on commit 203d050

Please sign in to comment.