diff --git a/src/index.ts b/src/index.ts index 532dc363d..119445706 100644 --- a/src/index.ts +++ b/src/index.ts @@ -218,3 +218,10 @@ if (config.hasHttp) { // Call the function to schedule the cron job to delete old logs scheduleCronJobs(oceanNode) } + +process.on('unhandledRejection', (reason) => { + console.log({ reason }) +}) +process.on('uncaughtException', (reason) => { + console.log({ reason }) +}) diff --git a/src/test/unit/download.test.ts b/src/test/unit/download.test.ts index da45d1d8d..2c8810c9f 100644 --- a/src/test/unit/download.test.ts +++ b/src/test/unit/download.test.ts @@ -20,6 +20,7 @@ import { AssetUtils, isConfidentialChainDDO } from '../../utils/asset.js' import { DEVELOPMENT_CHAIN_ID, KNOWN_CONFIDENTIAL_EVMS } from '../../utils/address.js' import { DDO } from '@oceanprotocol/ddo-js' import { Wallet, ethers } from 'ethers' +import { KeyManager } from '../../components/KeyManager/index.js' let envOverrides: OverrideEnvConfig[] let config: OceanNodeConfig @@ -35,8 +36,18 @@ describe('Should validate files structure for download', () => { ) envOverrides = await setupEnvironment(TEST_ENV_CONFIG_FILE, envOverrides) config = await getConfiguration(true) + const keyManager = new KeyManager(config) db = await Database.init(config.dbConfig) - oceanNode = OceanNode.getInstance(config, db) + oceanNode = OceanNode.getInstance( + config, + db, + null, + null, + null, + keyManager, + null, + true + ) consumerAccount = new Wallet(process.env.PRIVATE_KEY) })