diff --git a/backend/jest.config.js b/backend/jest.config.js index 640f8dd1f..39170c09f 100644 --- a/backend/jest.config.js +++ b/backend/jest.config.js @@ -2,5 +2,6 @@ module.exports = { verbose: true, preset: 'ts-jest', - collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**', '!**/?(*.)+test.ts'], + collectCoverage: true, + collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**'], } diff --git a/backend/src/util/decay.test.ts b/backend/src/util/decay.test.ts index 760780f93..0eec92b0c 100644 --- a/backend/src/util/decay.test.ts +++ b/backend/src/util/decay.test.ts @@ -8,4 +8,9 @@ describe('utils/decay', () => { oneSecondAgo.setSeconds(0) expect(decayFunction(1.0, oneSecondAgo, now)).toBe(0.99999997802044727) }) + + it('returns input amount when from and to is the same', () => { + const now = new Date() + expect(decayFunction(100.0, now, now)).toBe(100.0) + }) })