This repository has been archived on 2025-08-03. You can view files and clone it, but cannot push or open issues or pull requests.
network-orbit/jest.real.config.cjs
anonpenguin 8d3ccdc80c Add real integration tests for IPFS and OrbitDB
- Implemented real integration tests in `real-integration.test.ts` to validate the functionality of the DebrosFramework with IPFS and OrbitDB.
- Created `RealTestUser` and `RealTestPost` models for testing user and post functionalities.
- Developed setup and teardown lifecycle methods for managing the test environment.
- Introduced `RealIPFSService` and `RealOrbitDBService` classes for managing IPFS and OrbitDB instances.
- Added `PrivateSwarmSetup` for configuring a private IPFS network.
- Implemented utility functions for creating and shutting down IPFS and OrbitDB networks.
- Created a global test manager for managing test lifecycle and network state.
- Updated TypeScript configuration to include test files and exclude them from the main build.
2025-06-19 21:29:50 +03:00

52 lines
1.3 KiB
JavaScript

module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/tests/real'],
testMatch: ['**/real/**/*.test.ts'],
transform: {
'^.+\\.ts$': [
'ts-jest',
{
isolatedModules: true,
},
],
},
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts', '!src/**/index.ts', '!src/examples/**'],
coverageDirectory: 'coverage-real',
coverageReporters: ['text', 'lcov', 'html'],
// Extended timeouts for real network operations
testTimeout: 180000, // 3 minutes per test
// Run tests serially to avoid port conflicts and resource contention
maxWorkers: 1,
// Setup and teardown
globalSetup: '<rootDir>/tests/real/jest.global-setup.cjs',
globalTeardown: '<rootDir>/tests/real/jest.global-teardown.cjs',
// Environment variables for real tests
setupFilesAfterEnv: ['<rootDir>/tests/real/jest.setup.ts'],
// Longer timeout for setup/teardown
setupFilesTimeout: 120000,
// Disable watch mode (real tests are too slow)
watchman: false,
// Clear mocks between tests
clearMocks: true,
restoreMocks: true,
// Verbose output for debugging
verbose: true,
// Fail fast on first error (saves time with slow tests)
bail: 1,
// Module path mapping
moduleNameMapping: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@tests/(.*)$': '<rootDir>/tests/$1'
}
};