You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
465 B
16 lines
465 B
|
2 years ago
|
import { describe, expect, it } from '@jest/globals'
|
||
|
|
import getETA from './getETA.js'
|
||
|
|
|
||
|
|
describe('getETA', () => {
|
||
|
|
it('should get the ETA remaining based on a fileProgress object', () => {
|
||
|
|
const dateNow = new Date()
|
||
|
|
const date5SecondsAgo = new Date(dateNow.getTime() - 5 * 1000)
|
||
|
|
const fileProgress = {
|
||
|
|
bytesUploaded: 1024,
|
||
|
|
bytesTotal: 3096,
|
||
|
|
uploadStarted: date5SecondsAgo,
|
||
|
|
}
|
||
|
|
expect(getETA(fileProgress)).toEqual(10.1)
|
||
|
|
})
|
||
|
|
})
|