Fix test setup

This commit is contained in:
junderw 2022-08-20 09:46:18 +09:00
parent 1bc2c18167
commit d700b5f145
No known key found for this signature in database
GPG Key ID: A9273B5AD3E47B45
2 changed files with 59 additions and 53 deletions

View File

@ -1,5 +1,6 @@
import { calcDifficultyAdjustment, DifficultyAdjustment } from '../../api/difficulty-adjustment'; import { calcDifficultyAdjustment, DifficultyAdjustment } from '../../api/difficulty-adjustment';
describe('Mempool Difficulty Adjustment', () => {
test('should calculate Difficulty Adjustments properly', () => { test('should calculate Difficulty Adjustments properly', () => {
const dt = (dtString) => { const dt = (dtString) => {
return Math.floor(new Date(dtString).getTime() / 1000); return Math.floor(new Date(dtString).getTime() / 1000);
@ -58,3 +59,4 @@ test('should calculate Difficulty Adjustments properly', () => {
expect(result).toStrictEqual(vector[1]); expect(result).toStrictEqual(vector[1]);
} }
}); });
});

View File

@ -1 +1,5 @@
jest.mock('./mempool-config.json', () => ({}), { virtual: true }); jest.mock('./mempool-config.json', () => ({}), { virtual: true });
jest.mock('./src/logger.ts', () => ({}), { virtual: true });
jest.mock('./src/api/rbf-cache.ts', () => ({}), { virtual: true });
jest.mock('./src/api/mempool.ts', () => ({}), { virtual: true });
jest.mock('./src/api/memory-cache.ts', () => ({}), { virtual: true });