Add coverage report

This commit is contained in:
Moriz Wahl 2021-09-29 21:00:11 +02:00
parent fc0cf9d63e
commit be1cd15093
2 changed files with 7 additions and 1 deletions

View File

@ -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/**'],
}

View File

@ -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)
})
})