mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-31 05:50:08 +00:00
15 lines
465 B
JavaScript
15 lines
465 B
JavaScript
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)
|
|
})
|
|
})
|