From d01859dae7b04f311ed88bfa622b71201021f80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Maas?= Date: Wed, 8 May 2024 13:50:44 +0200 Subject: [PATCH] fix: Fixed broken tests --- packages/oid4vci-holder/__tests__/localAgent.test.ts | 9 ++------- packages/oid4vci-holder/__tests__/restAgent.test.ts | 8 ++------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/oid4vci-holder/__tests__/localAgent.test.ts b/packages/oid4vci-holder/__tests__/localAgent.test.ts index 74ce488e0..9790fed5e 100644 --- a/packages/oid4vci-holder/__tests__/localAgent.test.ts +++ b/packages/oid4vci-holder/__tests__/localAgent.test.ts @@ -1,24 +1,19 @@ -import { DataSource } from 'typeorm' import { createObjects, getConfig } from '../../agent-config/dist' +import eventLoggerAgentLogic from './shared/oid4vciHolderLogicAgentLogic' jest.setTimeout(60000) -import eventLoggerAgentLogic from './shared/oid4vciHolderLogicAgentLogic' - -let dbConnection: Promise let agent: any const setup = async (): Promise => { const config = await getConfig('packages/oid4vci-holder/agent.yml') - const { localAgent, db } = await createObjects(config, { localAgent: '/agent' }) + const { localAgent } = await createObjects(config, { localAgent: '/agent' }) agent = localAgent - dbConnection = db return true } const tearDown = async (): Promise => { - await (await dbConnection).close() return true } diff --git a/packages/oid4vci-holder/__tests__/restAgent.test.ts b/packages/oid4vci-holder/__tests__/restAgent.test.ts index e199d5419..cd2811840 100644 --- a/packages/oid4vci-holder/__tests__/restAgent.test.ts +++ b/packages/oid4vci-holder/__tests__/restAgent.test.ts @@ -2,8 +2,7 @@ import 'cross-fetch/polyfill' // @ts-ignore import express, { Router } from 'express' import { Server } from 'http' -import { DataSource } from 'typeorm' -import { IAgent, createAgent, IAgentOptions } from '@veramo/core' +import { createAgent, IAgent, IAgentOptions } from '@veramo/core' import { AgentRestClient } from '@veramo/remote-client' import { AgentRouter, RequestWithAgentRouter } from '@veramo/remote-server' import { createObjects, getConfig } from '../../agent-config/dist' @@ -17,7 +16,6 @@ const basePath = '/agent' let serverAgent: IAgent let restServer: Server -let dbConnection: Promise const getAgent = (options?: IAgentOptions) => createAgent({ @@ -33,9 +31,8 @@ const getAgent = (options?: IAgentOptions) => const setup = async (): Promise => { const config = await getConfig('packages/oid4vci-holder/agent.yml') - const { agent, db } = await createObjects(config, { agent: '/agent', db: '/dbConnection' }) + const { agent } = await createObjects(config, { agent: '/agent' }) serverAgent = agent - dbConnection = db const agentRouter: Router = AgentRouter({ exposedMethods: serverAgent.availableMethods(), @@ -56,7 +53,6 @@ const setup = async (): Promise => { const tearDown = async (): Promise => { restServer.close() - await (await dbConnection).close() return true }