1 | const getETA = require('./getETA')
|
2 |
|
3 | describe('getETA', () => {
|
4 | it('should get the ETA remaining based on a fileProgress object', () => {
|
5 | const dateNow = new Date()
|
6 | const date5SecondsAgo = new Date(dateNow.getTime() - 5 * 1000)
|
7 | const fileProgress = {
|
8 | bytesUploaded: 1024,
|
9 | bytesTotal: 3096,
|
10 | uploadStarted: date5SecondsAgo
|
11 | }
|
12 | expect(getETA(fileProgress)).toEqual(10.1)
|
13 | })
|
14 | })
|