- Implement comprehensive tests for RelationshipManager covering various relationship types (BelongsTo, HasMany, HasOne, ManyToMany) and eager loading functionality. - Include caching mechanisms and error handling in RelationshipManager tests. - Create unit tests for ShardManager to validate shard creation, routing, management, global index operations, and query functionalities. - Ensure tests cover different sharding strategies (hash, range, user) and handle edge cases like errors and non-existent models.
34 lines
792 B
JavaScript
34 lines
792 B
JavaScript
export default {
|
|
preset: 'ts-jest/presets/default-esm',
|
|
extensionsToTreatAsEsm: ['.ts'],
|
|
testEnvironment: 'node',
|
|
roots: ['<rootDir>/src', '<rootDir>/tests'],
|
|
testMatch: [
|
|
'**/__tests__/**/*.ts',
|
|
'**/?(*.)+(spec|test).ts'
|
|
],
|
|
transform: {
|
|
'^.+\\.ts$': ['ts-jest', {
|
|
useESM: true
|
|
}],
|
|
},
|
|
collectCoverageFrom: [
|
|
'src/**/*.ts',
|
|
'!src/**/*.d.ts',
|
|
'!src/**/index.ts',
|
|
'!src/examples/**',
|
|
],
|
|
coverageDirectory: 'coverage',
|
|
coverageReporters: [
|
|
'text',
|
|
'lcov',
|
|
'html'
|
|
],
|
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
|
testTimeout: 30000,
|
|
moduleNameMapping: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
'^@orbitdb/core$': '<rootDir>/tests/mocks/orbitdb.ts',
|
|
'^@helia/helia$': '<rootDir>/tests/mocks/ipfs.ts',
|
|
},
|
|
}; |